Gtk.SelectionData¶
Fields¶
None
Methods¶
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Details¶
- class Gtk.SelectionData¶
- copy()[source]¶
- Returns:
a pointer to a copy of self.
- Return type:
Makes a copy of a
Gtk.SelectionData
-struct and its data.
- free()[source]¶
Frees a
Gtk.SelectionData
-struct returned fromGtk.SelectionData.copy
().
- get_data()[source]¶
- Returns:
the raw data of the selection
- Return type:
Retrieves the raw data of the selection along with its length.
New in version 3.0.
- get_data_type()[source]¶
- Returns:
the data type of the selection.
- Return type:
Retrieves the data type of the selection.
New in version 2.14.
- get_display()[source]¶
- Returns:
the display of the selection.
- Return type:
Retrieves the display of the selection.
New in version 2.14.
- get_format()[source]¶
- Returns:
the format of the selection.
- Return type:
Retrieves the format of the selection.
New in version 2.14.
- get_length()[source]¶
- Returns:
the length of the data of the selection.
- Return type:
Retrieves the length of the raw data of the selection.
New in version 2.14.
- get_pixbuf()[source]¶
- Returns:
if the selection data contained a recognized image type and it could be converted to a
GdkPixbuf.Pixbuf
, a newly allocated pixbuf is returned, otherwiseNone
. If the result is non-None
it must be freed withGObject.Object.unref
().- Return type:
Gets the contents of the selection data as a
GdkPixbuf.Pixbuf
.New in version 2.6.
- get_selection()[source]¶
-
Retrieves the selection
Gdk.Atom
of the selection data.New in version 2.16.
- get_target()[source]¶
- Returns:
the target of the selection.
- Return type:
Retrieves the target of the selection.
New in version 2.14.
- get_targets()[source]¶
- Returns:
True
if self contains a valid array of targets, otherwiseFalse
.- targets:
location to store an array of targets. The result stored here must be freed with
GLib.free
().
- Return type:
Gets the contents of self 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.
- get_text()[source]¶
- 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
None
. If the result is non-None
it must be freed withGLib.free
().- Return type:
Gets the contents of the selection data as a UTF-8 string.
- get_uris()[source]¶
- Returns:
if the selection data contains a list of URIs, a newly allocated
None
-terminated string array containing the URIs, otherwiseNone
. If the result is non-None
it must be freed withGLib.strfreev
().- Return type:
[
str
]
Gets the contents of the selection data as array of URIs.
Since 3.24.37, this may involve using the FileTransfer portal to send files between sandboxed apps.
New in version 2.6.
- set(type, format, data)[source]¶
- Parameters:
Stores new data into a
Gtk.SelectionData
object. Should only be called from a selection handler callback. Zero-terminates the stored data.
- set_pixbuf(pixbuf)[source]¶
- Parameters:
pixbuf (
GdkPixbuf.Pixbuf
) – aGdkPixbuf.Pixbuf
- Returns:
True
if the selection was successfully set, otherwiseFalse
.- Return type:
Sets the contents of the selection from a
GdkPixbuf.Pixbuf
The pixbuf is converted to the form determined by self->target.New in version 2.6.
- set_text(str, len)[source]¶
-
Sets the contents of the selection from a UTF-8 encoded string. The string is converted to the form determined by self->target.
- set_uris(uris)[source]¶
- Parameters:
uris ([
str
]) – aNone
-terminated array of strings holding URIs- Returns:
True
if the selection was successfully set, otherwiseFalse
.- Return type:
Sets the contents of the selection from a list of URIs. The string is converted to the form determined by self->target.
Since 3.24.37, this may involve using the FileTransfer portal to send files between sandboxed apps.
New in version 2.6.
- targets_include_image(writable)[source]¶
- Parameters:
writable (
bool
) – whether to accept only targets for which GTK+ knows how to convert a pixbuf into the format- Returns:
True
if self holds a list of targets, and a suitable target for images is included, otherwiseFalse
.- Return type:
Given a
Gtk.SelectionData
object holding a list of targets, determines if any of the targets in targets can be used to provide aGdkPixbuf.Pixbuf
.New in version 2.6.
- targets_include_rich_text(buffer)[source]¶
- Parameters:
buffer (
Gtk.TextBuffer
) – aGtk.TextBuffer
- Returns:
True
if self holds a list of targets, and a suitable target for rich text is included, otherwiseFalse
.- Return type:
Given a
Gtk.SelectionData
object holding a list of targets, determines if any of the targets in targets can be used to provide rich text.New in version 2.10.
- targets_include_text()[source]¶
- Returns:
True
if self holds a list of targets, and a suitable target for text is included, otherwiseFalse
.- Return type:
Given a
Gtk.SelectionData
object holding a list of targets, determines if any of the targets in targets can be used to provide text.
- targets_include_uri()[source]¶
- Returns:
True
if self holds a list of targets, and a suitable target for URI lists is included, otherwiseFalse
.- Return type:
Given a
Gtk.SelectionData
object holding a list of targets, determines if any of the targets in targets can be used to provide a list or URIs.New in version 2.10.