Gdk.DragContext - Classes - Gdk 3.0 (original) (raw)
g GObject.Object GObject.Object Gdk.DragContext Gdk.DragContext GObject.Object->Gdk.DragContext
Subclasses:
None
Methods¶
Inherited:
Structs:
finish (success, del_, time) |
---|
get_actions () |
get_dest_window () |
get_device () |
get_drag_window () |
get_protocol () |
get_selected_action () |
get_source_window () |
get_suggested_action () |
list_targets () |
manage_dnd (ipc_window, actions) |
set_device (device) |
set_hotspot (hot_x, hot_y) |
Virtual Methods¶
Inherited:
Properties¶
None
Signals¶
Inherited:
Name | Short Description |
---|---|
action-changed | A new action is being chosen for the drag and drop operation. |
cancel | The drag and drop operation was cancelled. |
dnd-finished | The drag and drop operation was finished, the drag destination finished reading all data. |
drop-performed | The drag and drop operation was performed on an accepting client. |
Fields¶
Inherited:
Class Details¶
class Gdk.DragContext(**kwargs)¶
Bases:
Abstract:
No
finish(success, del_, time)¶
The type of the None singleton.
Returns:
the Gdk.DragAction flags
Return type:
Determines the bitmask of actions proposed by the source ifGdk.DragContext.get_suggested_action() returns Gdk.DragAction.ASK.
New in version 2.22.
Returns:
Return type:
Returns the destination window for the DND operation.
New in version 3.0.
Returns:
The Gdk.Device associated to self.
Return type:
Returns the Gdk.Device associated to the drag context.
Returns:
the drag window, or None
Return type:
Gdk.Window or None
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 self and will be destroyed when the drag operation is over.
New in version 3.20.
Returns:
the drag protocol
Return type:
Returns the drag protocol that is used by this context.
New in version 3.0.
get_selected_action()[source]¶
Returns:
a Gdk.DragAction value
Return type:
Determines the action chosen by the drag destination.
New in version 2.22.
Returns:
Return type:
Returns the Gdk.Window where the DND operation started.
New in version 2.22.
get_suggested_action()[source]¶
Returns:
a Gdk.DragAction value
Return type:
Determines the suggested drag action of the context.
New in version 2.22.
Returns:
a GLib.List of targets
Return type:
[Gdk.Atom]
Retrieves the list of targets of the context.
New in version 2.22.
manage_dnd(ipc_window, actions)[source]¶
Parameters:
- ipc_window (Gdk.Window) – Window to use for IPC messaging/events
- actions (Gdk.DragAction) – the actions supported by the drag source
Returns:
True if the drag and drop operation is managed.
Return type:
Requests the drag and drop operation to be managed by self. When a drag and drop operation becomes managed, the Gdk.DragContextwill 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 #GdkSelection 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.
New in version 3.20.
Parameters:
device (Gdk.Device) – a Gdk.Device
Associates a Gdk.Device to self, so all Drag and Drop events for self are emitted as if they came from this device.
set_hotspot(hot_x, hot_y)[source]¶
Parameters:
- hot_x (int) – x coordinate of the drag window hotspot
- hot_y (int) – y coordinate of the drag window hotspot
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.
New in version 3.20.
Signal Details¶
Gdk.DragContext.signals.action_changed(drag_context, action)¶
Signal Name:
action-changed
Flags:
Parameters:
- drag_context (Gdk.DragContext) – The object which received the signal
- action (Gdk.DragAction) – The action currently chosen
A new action is being chosen for the drag and drop operation.
This signal will only be emitted if the Gdk.DragContext manages the drag and drop operation. See Gdk.DragContext.manage_dnd() for more information.
New in version 3.20.
Gdk.DragContext.signals.cancel(drag_context, reason)¶
Signal Name:
cancel
Flags:
Parameters:
- drag_context (Gdk.DragContext) – The object which received the signal
- reason (Gdk.DragCancelReason) – The reason the context was cancelled
The drag and drop operation was cancelled.
This signal will only be emitted if the Gdk.DragContext manages the drag and drop operation. See Gdk.DragContext.manage_dnd() for more information.
New in version 3.20.
Gdk.DragContext.signals.dnd_finished(drag_context)¶
Signal Name:
dnd-finished
Flags:
Parameters:
drag_context (Gdk.DragContext) – The object which received the signal
The drag and drop operation was finished, the drag destination finished reading all data. The drag source can now free all miscellaneous data.
This signal will only be emitted if the Gdk.DragContext manages the drag and drop operation. See Gdk.DragContext.manage_dnd() for more information.
New in version 3.20.
Gdk.DragContext.signals.drop_performed(drag_context, time)¶
Signal Name:
drop-performed
Flags:
Parameters:
- drag_context (Gdk.DragContext) – The object which received the signal
- time (int) – the time at which the drop happened.
The drag and drop operation was performed on an accepting client.
This signal will only be emitted if the Gdk.DragContext manages the drag and drop operation. See Gdk.DragContext.manage_dnd() for more information.
New in version 3.20.