Create  Edit  FrontPage  Index  Search  Changes  History  RSS  Login

Gtk::SelectionData

class Gtk::SelectionData

A Gtk::SelectionData object is used to store information about a chunk of data associated with a selection.

Instance Methods

set(type, fmt, src)
set(type, src)
Stores new data into a Gtk::SelectionData object. Should only be called from a selection handler callback. Zero-terminates the stored data.
  • type: the type of selection data(GdkSelectionType; Warning GdkSelectionType is deprecated and should not be used in newly-written code. FIXME)
  • fmt: format (number of bits in a unit)
  • src: source of the data which depends on the type.
  • Returns: self
text
Gets the contents of the selection data as a UTF-8 string.
  • Returns: if the selection data contained a recognized text type and it could be converted to UTF-8, a newly allocated string containing the converted text, otherwise nil.
  • Returns: the contents of the selection data as a UTF-8 string.
text=(str)
Sets the contents of the selection from a UTF-8 encoded string. The string is converted to the form determined by Gtk::SelectionData#target. Raise RuntimeError if the selection was not successfully.
  • str: a UTF-8 string
  • Returns: str
set_text(str)
Same as Gtk::SelectionData#text=.
  • str: a UTF-8 string
  • Returns: self
targets
Gets the contents of selection_data as an array of targets. This can be used to interpret the results of getting the standard TARGETS target that is always supplied for any selection.
  • Returns : an array of targets(Gdk::Atom) or nil.
targets_include_text
Given a Gtk::SelectionData object holding a list of targets, determines if any of the targets in targets can be used to provide text.
  • Returns: true if selection_data holds a list of targets, and a suitable target for text is included, otherwise false.
selection
Gets the value of selection(Gdk::Atom)
  • Returns: the selection
target
Gets the value of target(Gdk::Atom)
  • Returns: the target
type
Gets the value of type(Gdk::Atom)
  • Returns: the type
format
Gets the value of format(Integer)
  • Returns: self
display
Gets the value of display(Gdk::Display) Since 2.2
  • Returns: self
data
  • Returns: self: FIXME
pixbuf
  • Returns: self: FIXME
pixbuf=
  • Returns: self: FIXME
set_pixbuf
  • Returns: self: FIXME
set_uris
  • Returns: self: FIXME
targets_include_image
  • Returns: self: FIXME
targets_include_rich_text
  • Returns: self: FIXME
targets_include_uri
  • Returns: self: FIXME
uris
  • Returns: self: FIXME
uris=
  • Returns: self: FIXME

See Also

Gtk::TargetList, Gtk::Selection.

Gtk::Widget - Much of the operation of selections happens via signals for Gtk::Widget. In particular, if you are using the methods in this section, you may need to pay attention to ::selection_get, ::selection_received, and :selection_clear_event signals.

Last modified:2012/11/23 04:02:03
Keyword(s):
References:[Gtk::TargetList] [index-ruby-gtk2] [Gtk::SelectionData] [Gdk::Selection] [News_20050306_1] [Gtk::Widget] [api-gtk-index] [Gtk::Selection] [Ruby/GTK]