Class: Gdk::DragContext

  • Object
show all
Defined in:

Instance Method Summary collapse

Instance Method Details


Determines the bitmask of actions proposed by the source if gdk_drag_context_get_suggested_action() returns %GDK_ACTION_ASK.



Returns the destination window for the DND operation.



Returns the Gdk::Device associated to the drag context.


  • (Gdk::Device)

    The Gdk::Device associated to context.

#device=(device) ⇒ nil

Associates a Gdk::Device to context, so all Drag and Drop events for context are emitted as if they came from this device.



  • (nil)


Returns the window on which the drag icon should be rendered during the drag operation. Note that the window may not be available until the drag operation has begun. GDK will move the window in accordance with the ongoing drag operation. The window is owned by context and will be destroyed when the drag operation is over.



Retrieves the list of targets of the context.


  • (GLib::List)

    a #GList of targets

#manage_dnd(ipc_window, actions) ⇒ TrueClass

Requests the drag and drop operation to be managed by context. When a drag and drop operation becomes managed, the Gdk::DragContext will internally handle all input and source-side Gdk::EventDND events as required by the windowing system.

Once the drag and drop operation is managed, the drag context will emit the following signals:

  • The Gdk::DragContext::action-changed signal whenever the final action to be performed by the drag and drop operation changes.

  • The Gdk::DragContext::drop-performed signal after the user performs the drag and drop gesture (typically by releasing the mouse button).

  • The Gdk::DragContext::dnd-finished signal after the drag and drop operation concludes (after all Gdk::Selection transfers happen).

  • The Gdk::DragContext::cancel signal if the drag and drop operation is finished but doesn’t happen over an accepting destination, or is cancelled through other means.


  • ipc_window (Gdk::Window)

    Window to use for IPC messaging/events

  • actions (Gdk::DragAction)

    the actions supported by the drag source


  • (TrueClass)

    #TRUE if the drag and drop operation is managed.


Returns the drag protocol that is used by this context.



Determines the action chosen by the drag destination.


#set_hotspot(hot_x, hot_y) ⇒ nil

Sets the position of the drag window that will be kept under the cursor hotspot. Initially, the hotspot is at the top left corner of the drag window.


  • hot_x (Integer)

    x coordinate of the drag window hotspot

  • hot_y (Integer)

    y coordinate of the drag window hotspot


  • (nil)


Returns the Gdk::Window where the DND operation started.



Determines the suggested drag action of the context.