Class: Gtk::DragSource

Inherits:
GestureSingle show all
Defined in:
(unknown)

Instance Method Summary collapse

Methods inherited from GestureSingle

#button, #button=, #current_button, #current_sequence, #exclusive, #exclusive=, #exclusive?, #touch_only, #touch_only=, #touch_only?

Methods inherited from Gesture

#device, #get_bounding_box, #get_bounding_box_center, #get_last_event, #get_point, #get_sequence_state, #group, #handles_sequence, #is_active, #is_grouped_with, #is_recognized, #last_updated_sequence, #n_points, #n_points=, #sequences, #set_sequence_state, #state=, #ungroup

Methods inherited from EventController

#current_event, #current_event_device, #current_event_state, #current_event_time, #name, #name=, #propagation_limit, #propagation_limit=, #propagation_phase, #propagation_phase=, #reset, #static_name=, #widget, #widget=

Constructor Details

#initializeGtk::DragSource

Creates a new GtkDragSource object.

Instance Method Details

#actionsGdk::DragAction

The actions that are supported by drag operations from the source.

Note that you must handle the [signalGtk.DragSource::drag-end] signal if the actions include %GDK_ACTION_MOVE.

Returns:

#actions=(actions) ⇒ Gdk::DragAction

The actions that are supported by drag operations from the source.

Note that you must handle the [signalGtk.DragSource::drag-end] signal if the actions include %GDK_ACTION_MOVE.

Parameters:

Returns:

#contentGdk::ContentProvider

The data that is offered by drag operations from this source.

Returns:

#content=(content) ⇒ Gdk::ContentProvider

The data that is offered by drag operations from this source.

Parameters:

Returns:

#dragGdk::Drag

Returns the underlying GdkDrag object for an ongoing drag.

Returns:

  • (Gdk::Drag)

    the GdkDrag of the current drag operation

#drag_cancelnil

Cancels a currently ongoing drag operation.

Returns:

  • (nil)

#set_icon(paintable, hot_x, hot_y) ⇒ nil

Sets a paintable to use as icon during DND operations.

The hotspot coordinates determine the point on the icon that gets aligned with the hotspot of the cursor.

If paintable is nil, a default icon is used.

This function can be called before a drag is started, or in a [signalGtk.DragSource::prepare] or [signalGtk.DragSource::drag-begin] signal handler.

Parameters:

  • paintable (Gdk::Paintable)

    the GdkPaintable to use as icon

  • hot_x (Integer)

    the hotspot X coordinate on the icon

  • hot_y (Integer)

    the hotspot Y coordinate on the icon

Returns:

  • (nil)