Gdk.DragContext¶
| Subclasses: | None | 
|---|
Methods¶
| Inherited: | GObject.Object (37) | 
|---|---|
| Structs: | GObject.ObjectClass (5) | 
| 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: | GObject.Object (7) | 
|---|
Properties¶
None
Signals¶
| Inherited: | GObject.Object (1) | 
|---|
| 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: | GObject.Object (1) | 
|---|
Class Details¶
- 
class Gdk.DragContext(**kwargs)¶
- Bases: - GObject.Object- Abstract: - No - 
finish(success, del_, time)¶
 - 
get_actions()[source]¶
- Returns: - the - Gdk.DragActionflags- Return type: - Gdk.DragAction- Determines the bitmask of actions proposed by the source if - Gdk.DragContext.get_suggested_action() returns- Gdk.DragAction.ASK.- New in version 2.22. 
 - 
get_dest_window()[source]¶
- Returns: - a - Gdk.Window- Return type: - Gdk.Window- Returns the destination window for the DND operation. - New in version 3.0. 
 - 
get_device()[source]¶
- Returns: - The - Gdk.Deviceassociated to self.- Return type: - Gdk.Device- Returns the - Gdk.Deviceassociated to the drag context.
 - 
get_drag_window()[source]¶
- Returns: - the drag window, or - None- Return type: - Gdk.Windowor- 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. 
 - 
get_protocol()[source]¶
- Returns: - the drag protocol - Return type: - Gdk.DragProtocol- Returns the drag protocol that is used by this context. - New in version 3.0. 
 - 
get_selected_action()[source]¶
- Returns: - a - Gdk.DragActionvalue- Return type: - Gdk.DragAction- Determines the action chosen by the drag destination. - New in version 2.22. 
 - 
get_source_window()[source]¶
- Returns: - a - Gdk.Window- Return type: - Gdk.Window- Returns the - Gdk.Windowwhere the DND operation started.- New in version 2.22. 
 - 
get_suggested_action()[source]¶
- Returns: - a - Gdk.DragActionvalue- Return type: - Gdk.DragAction- Determines the suggested drag action of the context. - New in version 2.22. 
 - 
list_targets()[source]¶
- Returns: - a - GLib.Listof 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: - Trueif 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.EventDNDevents 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-changedsignal whenever the final action to be performed by the drag and drop operation changes.
- The Gdk.DragContext::drop-performedsignal after the user performs the drag and drop gesture (typically by releasing the mouse button).
- The Gdk.DragContext::dnd-finishedsignal after the drag and drop operation concludes (after all #GdkSelection transfers happen).
- The Gdk.DragContext::cancelsignal 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. 
- ipc_window (
 - 
set_device(device)[source]¶
- Parameters: - device ( - Gdk.Device) – a- Gdk.Device- Associates a - Gdk.Deviceto self, so all Drag and Drop events for self are emitted as if they came from this device.
 
- 
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.DragContextmanages the drag and drop operation. See- Gdk.DragContext.manage_dnd() for more information.- New in version 3.20. 
- drag_context (
- 
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.DragContextmanages the drag and drop operation. See- Gdk.DragContext.manage_dnd() for more information.- New in version 3.20. 
- drag_context (
- 
Gdk.DragContext.signals.dnd_finished(drag_context)¶
- Signal Name: - dnd-finished- Flags: - RUN_LAST- 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.DragContextmanages 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.DragContextmanages the drag and drop operation. See- Gdk.DragContext.manage_dnd() for more information.- New in version 3.20. 
- drag_context (