Interface: DragSourceProps
Defined in: types.ts:42
Props for DragSource controller.
Enables dragging content from a widget. Attach a DragSource to make a widget draggable.
Properties
dragActions?
optionaldragActions:DragAction
Defined in: types.ts:72
The allowed drag actions (COPY, MOVE, LINK, ASK). Defaults to Gdk.DragAction.COPY if not specified.
onDragBegin()?
optionalonDragBegin: (drag) =>void
Defined in: types.ts:54
Called when the drag operation begins.
Parameters
| Parameter | Type | Description |
|---|---|---|
drag | Drag | The Gdk.Drag object representing the ongoing drag |
Returns
void
onDragCancel()?
optionalonDragCancel: (drag,reason) =>boolean
Defined in: types.ts:67
Called when the drag operation is cancelled.
Parameters
| Parameter | Type | Description |
|---|---|---|
drag | Drag | The Gdk.Drag object |
reason | DragCancelReason | The reason for cancellation |
Returns
boolean
true if the cancel was handled
onDragEnd()?
optionalonDragEnd: (drag,deleteData) =>void
Defined in: types.ts:60
Called when the drag operation ends.
Parameters
| Parameter | Type | Description |
|---|---|---|
drag | Drag | The Gdk.Drag object |
deleteData | boolean | Whether the data should be deleted (for move operations) |
Returns
void
onDragPrepare()?
optionalonDragPrepare: (x,y) =>ContentProvider|null
Defined in: types.ts:49
Called when a drag is about to start. Return a ContentProvider with the data to be dragged, or null to cancel the drag.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | X coordinate where drag started |
y | number | Y coordinate where drag started |
Returns
ContentProvider | null