Class: Gdk::DragContext

Inherits:
Object
  • Object
show all
Defined in:
(unknown)

Instance Method Summary collapse

Instance Method Details

#actionsGdk::DragAction

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

Returns:

#dest_windowGdk::Window

Returns the destination window for the DND operation.

Returns:

#deviceGdk::Device

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

Returns:

  • (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.

Parameters:

Returns:

  • (nil)

#drag_windowGdk::Window

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.

Returns:

#list_targetsGLib::List

Retrieves the list of targets of the context.

Returns:

  • (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.

Parameters:

  • ipc_window (Gdk::Window)

    Window to use for IPC messaging/events

  • actions (Gdk::DragAction)

    the actions supported by the drag source

Returns:

  • (TrueClass)

    #TRUE if the drag and drop operation is managed.

#protocolGdk::DragProtocol

Returns the drag protocol that is used by this context.

Returns:

#selected_actionGdk::DragAction

Determines the action chosen by the drag destination.

Returns:

#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.

Parameters:

  • hot_x (Integer)

    x coordinate of the drag window hotspot

  • hot_y (Integer)

    y coordinate of the drag window hotspot

Returns:

  • (nil)

#source_windowGdk::Window

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

Returns:

#suggested_actionGdk::DragAction

Determines the suggested drag action of the context.

Returns: