Gtk2::G...Context(3)

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

πŸ’… Gtk2::G...Context(3) β€” bestie edition πŸ’…

okay so this is the manual page for Gtk2::Gdk::DragContext β€” a wrapper for GdkDragContext, straight out of the User Contributed Perl Documentation collection, and honestly? drag and drop lore is so underrated. sit down, grab a strawberry πŸ“, we're doing this.


✨ HIERARCHY ✨

the family tree, no cap:

Glib::Object
+----Gtk2::Gdk::DragContext

so like, it's a Glib::Object at heart, but it woke up and chose drag-and-drop πŸ’–


πŸŽ€ METHODS πŸŽ€

  • dragcontext = Gtk2::Gdk::DragContext->new β€” make a brand new drag context. main character origin story, fr.
  • $context->abort ($time_) β€” abort the whole drag. dramatic exit, we love to see it.
    • $time_ (unsigned)
  • scalar = $dc->action β€” the action. just vibes as a scalar.
  • scalar = $dc->actions β€” the actions, plural. also a scalar. iykyk.
  • dragaction = $context->get_actions β€” get the actions. Since: gtk+ 2.22
  • dragcontext = Gtk2::Gdk::DragContext->begin ($window, ...) β€” start a drag on a window, with a list of atoms.
    • $window (Gtk2::Gdk::Window)
    • ... (list) of Gtk2::Gdk::Atom's
  • scalar = $dc->dest_window β€” the destination window, as a scalar.
  • boolean = $context->drag_drop_succeeded β€” did the drop actually slay? boolean says yes or no. Since: gtk+ 2.6
  • $context->drop ($time_) β€” drop it. πŸ’…
    • $time_ (unsigned)
  • $context->drop_finish ($success, $time_=GDK_CURRENT_TIME) β€” wrap up the drop. note the default $time_ is GDK_CURRENT_TIME, cute.
    • $success (boolean)
    • $time_ (unsigned)
  • $context->drop_reply ($ok, $time_=GDK_CURRENT_TIME) β€” reply to the drop, default time GDK_CURRENT_TIME again.
    • $ok (boolean)
    • $time_ (unsigned)
  • (dest_window, protocol) = $context->find_window ($drag_window, $x_root, $y_root) β€” find the window, get back both a dest window and a protocol. two for one, iconic.
    • $drag_window (Gtk2::Gdk::Window)
    • $x_root (integer)
    • $y_root (integer)
  • (dest_window, protocol) = $context->find_window_for_screen ($drag_window, $screen, $x_root, $y_root) β€” same deal but you specify the screen too.
    • $drag_window (Gtk2::Gdk::Window)
    • $screen (Gtk2::Gdk::Screen)
    • $x_root (integer)
    • $y_root (integer)
    • Since: gtk+ 2.2
  • $context->finish ($success, $del, $time_) β€” finish it. periodt.
    • $success (boolean)
    • $del (boolean)
    • $time_ (unsigned)
  • $context->set_icon_default β€” use the default icon, zero thoughts, just vibes.
  • $context->set_icon_name ($icon_name, $hot_x, $hot_y) β€” set the icon by name, with a hot spot.
    • $icon_name (string)
    • $hot_x (integer)
    • $hot_y (integer)
    • Since: gtk+ 2.8
  • $context->set_icon_pixbuf ($pixbuf, $hot_x, $hot_y) β€” pixbuf icon era.
    • $pixbuf (Gtk2::Gdk::Pixbuf)
    • $hot_x (integer)
    • $hot_y (integer)
  • $context->set_icon_pixmap ($colormap, $pixmap, $mask, $hot_x, $hot_y) β€” the full pixmap situation, colormap and all. note $mask can be undef, bestie, that's allowed.
    • $colormap (Gtk2::Gdk::Colormap)
    • $pixmap (Gtk2::Gdk::Pixmap)
    • $mask (Gtk2::Gdk::Bitmap or undef)
    • $hot_x (integer)
    • $hot_y (integer)
  • $context->set_icon_stock ($stock_id, $hot_x, $hot_y) β€” stock icon, retro but make it work.
    • $stock_id (string)
    • $hot_x (integer)
    • $hot_y (integer)
  • $context->set_icon_widget ($widget, $hot_x, $hot_y) β€” use an actual widget as the drag icon. chaos, but the good kind.
    • $widget (Gtk2::Widget)
    • $hot_x (integer)
    • $hot_y (integer)
  • scalar = $dc->is_source β€” are we the source? scalar says.
  • list = $context->list_targets β€” get the target list. Since: gtk+ 2.22
  • boolean = $context->motion ($dest_window, $protocol, $x_root, $y_root, $suggested_action, $possible_actions, $time_) β€” tell the context the mouse moved. big signature, big energy.
    • $dest_window (Gtk2::Gdk::Window)
    • $protocol (Gtk2::Gdk::DragProtocol)
    • $x_root (integer)
    • $y_root (integer)
    • $suggested_action (Gtk2::Gdk::DragAction)
    • $possible_actions (Gtk2::Gdk::DragAction)
    • $time_ (unsigned)
  • scalar = $dc->protocol β€” the protocol, as a scalar.
  • (ret, protocol) = Gtk2::Gdk::DragContext->get_protocol_for_display ($display, $xid) β€” class method, protocol for a display.
    • $display (Gtk2::Gdk::Display)
    • $xid (unsigned)
    • Since: gtk+ 2.2
  • (ret, protocol) = Gtk2::Gdk::DragContext->get_protocol ($xid) β€” class method, protocol from an xid.
    • $xid (unsigned)
  • dragaction = $context->get_selected_action β€” the action that got selected. Since: gtk+ 2.22
  • atom = $context->get_selection β€” get the selection atom.
  • widget = $context->get_source_widget β€” get the source widget.
  • scalar = $dc->source_window β€” source window, scalar, you know the drill.
  • window = $context->get_source_window β€” get the source window. Since: gtk+ 2.22
  • scalar = $dc->start_time β€” when did it start? scalar.
  • $context->status ($action, $time_=GDK_CURRENT_TIME) β€” set the status. default $time_ is GDK_CURRENT_TIME 🫢
    • $action (Gtk2::Gdk::DragAction)
    • $time_ (unsigned)
  • scalar = $dc->suggested_action β€” suggested action, scalar.
  • dragaction = $context->get_suggested_action β€” get the suggested action. Since: gtk+ 2.22
  • list = $dc->targets β€” returns a list of Gtk2::Gdk::Atom's, the targets. that's literally what it does bestie, no notes.

🌈 ENUMS AND FLAGS 🌈

πŸ¦‹ flags Gtk2::Gdk::DragAction

the action menu, pick your fighter:

  • 'default' / GDK_ACTION_DEFAULT
  • 'copy' / GDK_ACTION_COPY
  • 'move' / GDK_ACTION_MOVE
  • 'link' / GDK_ACTION_LINK
  • 'private' / GDK_ACTION_PRIVATE
  • 'ask' / GDK_ACTION_ASK

🧚 enum Gtk2::Gdk::DragProtocol

the protocol roster:

  • 'motif' / GDK_DRAG_PROTO_MOTIF
  • 'xdnd' / GDK_DRAG_PROTO_XDND
  • 'rootwin' / GDK_DRAG_PROTO_ROOTWIN
  • 'none' / GDK_DRAG_PROTO_NONE
  • 'win32-dropfiles' / GDK_DRAG_PROTO_WIN32_DROPFILES
  • 'ole2' / GDK_DRAG_PROTO_OLE2
  • 'local' / GDK_DRAG_PROTO_LOCAL

πŸ‘‘ SEE ALSO πŸ‘‘

  • Gtk2
  • Glib::Object

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, bestie πŸŽ€ this was generated by perl v5.42.0 on 2025-07-25, and it's literally giving "Gtk2::G...Context(3)" energy. slay, stay hydrated, and may your drops always succeed βœ¨πŸ¦‹πŸ’–

πŸ“¦ where this page comes from