Gtk2::G...Context(3)
π 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.22dragcontext = 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_isGDK_CURRENT_TIME, cute.$success(boolean)$time_(unsigned)
$context->drop_reply ($ok, $time_=GDK_CURRENT_TIME)β reply to the drop, default timeGDK_CURRENT_TIMEagain.$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$maskcan beundef, 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.22boolean = $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.22atom = $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.22scalar = $dc->start_timeβ when did it start? scalar.$context->status ($action, $time_=GDK_CURRENT_TIME)β set the status. default$time_isGDK_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.22list = $dc->targetsβ returns a list ofGtk2::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 π
Gtk2Glib::Object
π 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, 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
- 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