Gtk2::TargetList(3)

πŸ“¦
version 1.24993 Β· 2 versions
, in fedora 43

πŸ’– Gtk2::TargetList β€” ok bestie, let's talk drag-and-drop πŸ’–

So <pink>Gtk2::TargetList</pink> is literally just a wrapper for GtkTargetList in the Gtk2 Perl bindings, and it lives in the Gtk2::TargetList(3) manpage, which is what you're reading rn. It's the whole vibe of "what kinds of data can this widget even accept" β€” the guest list for your drag-and-drop party πŸŽ€


πŸ¦‹ HIERARCHY πŸ¦‹

This is where it sits in the family tree, and yes it's giving nepo baby:

Glib::Boxed
+----Gtk2::TargetList

✨ METHODS ✨

🌸 targetlist = Gtk2::TargetList->new (...)

Build a whole new target list from scratch, queen πŸ‘‘

  • ... β€” a (list) of Gtk2::TargetEntry's. That's it, that's the whole guest list.

🌈 $list->add ($target, $flags, $info)

Add one single target to the list. One in, one out, no drama πŸ’…

  • $target β€” a Gtk2::Gdk::Atom
  • $flags β€” an integer
  • $info β€” an integer

πŸŽ€ $list->add_image_targets ($info, $writable)

Adds all the image targets in one go, so you don't have to list them yourself. Iconic behaviour honestly ✨

  • $info β€” an integer
  • $writable β€” a boolean
Since: gtk+ 2.6 β€” so if you're on something ancient, this one's not gonna show up for you 😭

🧚 $list->add_rich_text_targets ($info, $deserializable, $buffer)

Rich text targets, added as a bundle. Very fancy, very demure 🫢

  • $info β€” an integer
  • $deserializable β€” a boolean
  • $buffer β€” a Gtk2::TextBuffer
Since: gtk+ 2.10 β€” newer than the image one, just so you know 🌸

πŸ‘‘ $list->add_table (...)

Add a whole table of entries at once, because doing it one by one is not the move.

  • ... β€” a (list) of Gtk2::TargetEntry's

⭐ $list->add_text_targets ($info)

All the text targets, boom, done, no cap.

  • $info β€” an integer
Since: gtk+ 2.6

πŸ”₯ $list->add_uri_targets ($info)

URIs get their own little bundle too. Slay.

  • $info β€” an integer
Since: gtk+ 2.6

πŸ’œ integer = $list->find ($target)

Look up a target in the list and get back an integer. It's giving detective energy πŸ”

  • $target β€” a Gtk2::Gdk::Atom

πŸ™ˆ $list->remove ($target)

Bye bye target, we hardly knew ye. Removes it from the list πŸ’€

  • $target β€” a Gtk2::Gdk::Atom

🌟 SEE ALSO 🌟

Go read these next, bestie, they're all connected:

  • Gtk2
  • Glib::Boxed
  • Gtk2::TargetEntry

Copyright (C) 2003-2011 by the gtk2-perl team.

This software is licensed under the LGPL. See Gtk2 for a full notice.


Ok that's the whole page, you ate it up fr fr πŸ“ This was perl v5.42.0, dated 2025-07-25, and it's the Gtk2::TargetList(3) manpage β€” go forth and drag-and-drop responsibly, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from