Gdk.DragContext¶
- Subclasses:
 None
Methods¶
- Inherited:
 - Structs:
 
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
|
  | 
Virtual Methods¶
- Inherited:
 
Properties¶
None
Signals¶
- Inherited:
 
Name  | 
Short Description  | 
|---|---|
A new action is being chosen for the drag and drop operation.  | 
|
The drag and drop operation was cancelled.  | 
|
The drag and drop operation was finished, the drag destination finished reading all data.  | 
|
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.
- get_actions()[source]¶
 - Returns:
 the
Gdk.DragActionflags- Return type:
 
Determines the bitmask of actions proposed by the source if
Gdk.DragContext.get_suggested_action() returnsGdk.DragAction.ASK.New in version 2.22.
- get_dest_window()[source]¶
 - Returns:
 - Return type:
 
Returns the destination window for the DND operation.
New in version 3.0.
- get_device()[source]¶
 - Returns:
 The
Gdk.Deviceassociated to self.- Return type:
 
Returns the
Gdk.Deviceassociated to the drag context.
- get_drag_window()[source]¶
 - Returns:
 the drag window, or
None- Return type:
 Gdk.WindoworNone
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:
 
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:
 
Determines the action chosen by the drag destination.
New in version 2.22.
- get_source_window()[source]¶
 - Returns:
 - Return type:
 
Returns the
Gdk.Windowwhere the DND operation started.New in version 2.22.
- get_suggested_action()[source]¶
 - Returns:
 a
Gdk.DragActionvalue- Return type:
 
Determines the suggested drag action 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/eventsactions (
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-sideGdk.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.
- set_device(device)[source]¶
 - Parameters:
 device (
Gdk.Device) – aGdk.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 signalaction (
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. SeeGdk.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 signalreason (
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. SeeGdk.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.DragContextmanages the drag and drop operation. SeeGdk.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 signaltime (
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. SeeGdk.DragContext.manage_dnd() for more information.New in version 3.20.