Class: Gdk::Drag
- Inherits:
-
Object
- Object
- Gdk::Drag
- Defined in:
- (unknown)
Overview
The GdkDrag object represents the source of an ongoing DND operation.
A GdkDrag is created when a drag is started, and stays alive for duration of
the DND operation. After a drag has been started with [funcGdk.Drag.begin],
the caller gets informed about the status of the ongoing drag operation
with signals on the GdkDrag object.
GTK provides a higher level abstraction based on top of these functions, and so they are not normally needed in GTK applications. See the "Drag and Drop" section of the GTK documentation for more information.
Class Method Summary collapse
-
.begin(surface, device, content, actions, dx, dy) ⇒ Gdk::Drag
Starts a drag and creates a new drag context for it.
Instance Method Summary collapse
-
#actions ⇒ Gdk::DragAction
The possible actions of this drag.
-
#actions=(actions) ⇒ Gdk::DragAction
The possible actions of this drag.
-
#content ⇒ Gdk::ContentProvider
The
GdkContentProvider. -
#content=(content) ⇒ Gdk::ContentProvider
The
GdkContentProvider. -
#device ⇒ Gdk::Device
The
GdkDevicethat is performing the drag. -
#device=(device) ⇒ Gdk::Device
The
GdkDevicethat is performing the drag. -
#display ⇒ Gdk::Display
The
GdkDisplaythat the drag belongs to. -
#display=(display) ⇒ Gdk::Display
The
GdkDisplaythat the drag belongs to. -
#drag_surface ⇒ Gdk::Surface
Returns the surface on which the drag icon should be rendered during the drag operation.
-
#drop_done(success) ⇒ nil
Informs GDK that the drop ended.
-
#formats ⇒ Gdk::ContentFormats
The possible formats that the drag can provide its data in.
-
#formats=(formats) ⇒ Gdk::ContentFormats
The possible formats that the drag can provide its data in.
-
#selected_action ⇒ Gdk::DragAction
The currently selected action of the drag.
-
#selected_action=(selected_action) ⇒ Gdk::DragAction
The currently selected action of the drag.
-
#set_hotspot(hot_x, hot_y) ⇒ nil
Sets the position of the drag surface that will be kept under the cursor hotspot.
-
#surface ⇒ Gdk::Surface
The surface where the drag originates.
-
#surface=(surface) ⇒ Gdk::Surface
The surface where the drag originates.
Class Method Details
.begin(surface, device, content, actions, dx, dy) ⇒ Gdk::Drag
Starts a drag and creates a new drag context for it.
This function is called by the drag source. After this call, you probably want to set up the drag icon using the surface returned by [methodGdk.Drag.get_drag_surface].
This function returns a reference to the [classGdk.Drag] object, but GTK keeps its own reference as well, as long as the DND operation is going on.
Note: if actions include %GDK_ACTION_MOVE, you need to listen for the [signalGdk.Drag::dnd-finished] signal and delete the data at the source if [methodGdk.Drag.get_selected_action] returns %GDK_ACTION_MOVE.
Instance Method Details
#actions ⇒ Gdk::DragAction
The possible actions of this drag.
#actions=(actions) ⇒ Gdk::DragAction
The possible actions of this drag.
#content ⇒ Gdk::ContentProvider
The GdkContentProvider.
#content=(content) ⇒ Gdk::ContentProvider
The GdkContentProvider.
#device ⇒ Gdk::Device
The GdkDevice that is performing the drag.
#device=(device) ⇒ Gdk::Device
The GdkDevice that is performing the drag.
#display ⇒ Gdk::Display
The GdkDisplay that the drag belongs to.
#display=(display) ⇒ Gdk::Display
The GdkDisplay that the drag belongs to.
#drag_surface ⇒ Gdk::Surface
Returns the surface on which the drag icon should be rendered during the drag operation.
Note that the surface may not be available until the drag operation has begun. GDK will move the surface in accordance with the ongoing drag operation. The surface is owned by drag and will be destroyed when the drag operation is over.
#drop_done(success) ⇒ nil
Informs GDK that the drop ended.
Passing false for success may trigger a drag cancellation animation.
This function is called by the drag source, and should be the last call before dropping the reference to the drag.
The GdkDrag will only take the first [methodGdk.Drag.drop_done]
call as effective, if this function is called multiple times,
all subsequent calls will be ignored.
#formats ⇒ Gdk::ContentFormats
The possible formats that the drag can provide its data in.
#formats=(formats) ⇒ Gdk::ContentFormats
The possible formats that the drag can provide its data in.
#selected_action ⇒ Gdk::DragAction
The currently selected action of the drag.
#selected_action=(selected_action) ⇒ Gdk::DragAction
The currently selected action of the drag.
#set_hotspot(hot_x, hot_y) ⇒ nil
Sets the position of the drag surface that will be kept under the cursor hotspot.
Initially, the hotspot is at the top left corner of the drag surface.
#surface ⇒ Gdk::Surface
The surface where the drag originates.
#surface=(surface) ⇒ Gdk::Surface
The surface where the drag originates.