TTkDrag🌶️

class TTkDrag(**kwargs)[source]🌶️

Bases: TTkDnD

Methods🌶️

data() Any🌶️

Returns the data attached to this Drag object

Returns:

The data attached to this Drag object

Return type:

Any

exec() None[source]🌶️

Starts the drag operation.

getDragEnterEvent(evt: TTkMouseEvent) TTkDnDEvent[source]🌶️

Returns a Drag and Drop event for the DragEnter event.

Parameters:

evt (TTkMouseEvent) – The mouse event

Returns:

The Drag and Drop event

Return type:

TTkDnDEvent

getDragLeaveEvent(evt: TTkMouseEvent) TTkDnDEvent[source]🌶️

Returns a Drag and Drop event for the DragLeave event.

Parameters:

evt (TTkMouseEvent) – The mouse event

Returns:

The Drag and Drop event

Return type:

TTkDnDEvent

getDragMoveEvent(evt: TTkMouseEvent) TTkDnDEvent[source]🌶️

Returns a Drag and Drop event for the DragMove event.

Parameters:

evt (TTkMouseEvent) – The mouse event

Returns:

The Drag and Drop event

Return type:

TTkDnDEvent

getDropEvent(evt: TTkMouseEvent) TTkDnDEvent[source]🌶️

Returns a Drag and Drop event for the Drop event.

Parameters:

evt (TTkMouseEvent) – The mouse event

Returns:

The Drag and Drop event

Return type:

TTkDnDEvent

hidePixmap() None[source]🌶️

Hides the pixmap used to represent the data in a drag and drop operation.

hotSpot() tuple[int, int]🌶️

Returns the position of the hot spot relative to the top-left corner of the cursor.

Returns:

the hotspot position

Return type:

tuple[int,int]

pixmap() TTkCanvas[source]🌶️

Returns the pixmap used to represent the data in a drag and drop operation.

Returns:

the pixmap used to represent the data in a drag and drop operation.

Return type:

TTkCanvas

setData(data: Any) None🌶️

The data attached to this Drag object

Parameters:

data (Any) – The data attached to this Drag object

setHotSpot(pos: tuple[int, int]) None🌶️

Sets the position of the hot spot relative to the top-left corner of the pixmap used to the point specified by hotspot.

Parameters:

pos (tuple[int,int]) – the hotspot position

setPixmap(pixmap: TTkWidget) None[source]🌶️

Sets the pixmap used to represent the data in a drag and drop operation. If a TTkWidget is provided as pixmap, its default rendering will be used in the pixmap TTkCanvas.

Parameters:

pixmap (TTkWidget or TTkCanvas) – the pixmap

showPixmap() None[source]🌶️

Shows the pixmap used to represent the data in a drag and drop operation.

visible() bool[source]🌶️

Returns pixmap’s visibility status.

Returns:

True if the pixmap is visible, False otherwise.

Return type:

bool