Gtk2::TargetEntry(3)
π Gtk2::TargetEntry π
okay so bestie, welcome to Gtk2::TargetEntry β that's the Gtk2::TargetEntry(3) page, straight outta the User Contributed Perl Documentation collection. sit down, grab a strawberry π, we're gonna talk about drag types. yes really. it's gonna be iconic, trust.
β¨ SYNOPSIS β¨
you can write it two ways, and both are valid, no cap:
# as a HASH
$target_entry = {
target => 'text/plain', # some string representing the drag type
flags => [], # Gtk2::TargetFlags
info => 42, # some app-defined integer identifier
};
# as an ARRAY, for compactness
$target_entry = [ $target, $flags, $info ];
so like β hash if you wanna be β¨expressiveβ¨, array if you're in your minimalism era. both eat. π
π¦ DESCRIPTION π¦
okay so a Gtk2::TargetEntry data structure represents a single type of data that a widget can supply for a selection, or that gets supplied or received during drag-and-drop. it's giving tiny little ID card for one drag type. π
inside it there's:
- a string representing the drag type,
- a
flagsfield β and heads up, this one is used only for drag and drop, seeGtk2::TargetFlags, - and an application assigned integer ID.
and the way that integer ID comes back?? it gets passed later as a signal parameter for signals like "selection_get". π
why do we care, you ask? because it lets the application identify the target type without extensive string compares. no string compare grindset. we're just out here vibing with ints. periodt.
π ENUMS AND FLAGS π
flags Gtk2::TargetFlags
here's the whole menu, no skips, no substitutions:
'same-app'/'GTK_TARGET_SAME_APP''same-widget'/'GTK_TARGET_SAME_WIDGET''other-app'/'GTK_TARGET_OTHER_APP''other-widget'/'GTK_TARGET_OTHER_WIDGET'
four flags, all accounted for, iykyk. πΈ
π₯ SEE ALSO π₯
go check out Gtk2 and Gtk2::TargetList β they're the rest of this little friend group. π«Ά
π COPYRIGHT π
Copyright (C) 2003-2011 by the gtk2-perl team.
This software is licensed under the LGPL. See Gtk2 for a full notice.
ngl, always read the license. it's the vibe check for legal stuff. π
and that's the whole page, bestie!! β¨ this gorgeous little number shipped as perl v5.42.0 on 2025-07-25 β so when you cite it, cite it right. mwah, bye πππ¦
π¦ 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