Gtk2::S...tionData(3)
π Gtk2::SelectionData β the wrapper for GtkSelectionData π
okay bestie, so this is Gtk2::SelectionData, a Perl wrapper situation for GtkSelectionData β like, the thing that carries clipboard/selection data around in GTK land. She's from the User Contributed Perl Documentation corner of the internet and she is serving. Let's get into it β¨
π¦ HIERARCHY π¦
the family tree, she's a nepo baby but make it boxed:
Glib::Boxed
+----Gtk2::SelectionData
so yeah, Gtk2::SelectionData is a child of Glib::Boxed. iconic lineage tbh π
β¨ METHODS β¨
scalar = $d->get_data
gets you the data, as a scalar. simple. clean. π
scalar = $d->get_data_type
hands you the data type. it's giving scalar. π
scalar = $d->get_display
the display. scalar. we love a one-word answer. π«Ά
scalar = $d->get_format
the format, as a scalar. no cap.
$selection_data->set ($type, $format, $data)
sets the whole thing up. here's what you're feeding her:
$typeβ aGtk2::Gdk::Atomπ$formatβ an integer$dataβ aGlib::UChar
scalar = $d->get_length
the length. scalar. that's it, that's the tweet. π
pixbuf or undef = $selection_data->get_pixbuf
you get a pixbufβ¦ or undef, bestie, it's giving mystery π
Since: gtk+ 2.6 β¨
boolean = $selection_data->set_pixbuf ($pixbuf)
$pixbufβ aGtk2::Gdk::Pixbufπ
Since: gtk+ 2.6 β¨
(tree_model, path) = $selection_data->get_row_drag_data
okay so the tea here: if $selection_data is not of target type GTK_TREE_MODEL_ROW, then the return is an empty list. that's the whole rule. periodt. π
boolean = $selection_data->set_row_drag_data ($tree_model, $path)
$tree_modelβ aGtk2::TreeModelπ$pathβ aGtk2::TreePathπ¦
scalar = $d->get_selection
scalar. the selection. you know the vibe. β¨
scalar = $d->get_target
scalar. the target. π―
list = $selection_data->get_targets
so this one grabs the contents of selection_data as an array of targets. main character energy. you'd use this to interpret the results of getting the standard TARGETS target β which, btw, is always supplied for any selection. like, always always. π
Returns a list of GdkAtoms, the targets. π
boolean = $selection_data->targets_include_image ($writable)
$writableβ a boolean πΈ
Since: gtk+ 2.6 β¨
boolean = $selection_data->targets_include_rich_text ($buffer)
$bufferβ aGtk2::TextBufferπ
Since: gtk+ 2.10 β¨
boolean = $selection_data->targets_include_text
does it include text? boolean. yes or no, no in-between. π
boolean = $selection_data->targets_include_uri
does it include a URI? boolean. again, binary decision. π¦
Since: gtk+ 2.10 β¨
string = $selection_data->get_text
gives you the text. as a string. slay. β¨
boolean = $selection_data->set_text ($str, $len=-1)
$strβ a string π$lenβ an integer, and she defaults to-1if you don't say anything π
list = $selection_data->get_uris
a whole list of URIs, bestie. π
Since: gtk+ 2.6 β¨
boolean = $selection_data->set_uris (...)
...β a list of strings π
Since: gtk+ 2.6 β¨
π SEE ALSO π
go read these next, fr fr:
Gtk2Glib::Boxed
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice. π«Ά
and that's the whole page, babe π this was documented by the gtk2-perl girlies, generated with perl v5.42.0 on 2025-07-25, and it's literally the Gtk2::S...tionData(3) page. you ate that πβ¨π
π¦ where this page comes from
- fedora 43: perl-Gtk2 1.24993-23.fc43 Β· LicenseRef-Callaway-LGPLv2+
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms