Interface: DropTargetProps
Defined in: types.ts:81
Props for DropTarget controller.
Enables dropping content onto a widget. Attach a DropTarget to make a widget accept drops.
Properties
dropActions?
optionaldropActions:DragAction
Defined in: types.ts:112
The allowed drop actions (COPY, MOVE, LINK, ASK). Defaults to Gdk.DragAction.COPY if not specified.
dropTypes?
optionaldropTypes:number[]
Defined in: types.ts:117
Array of GTypes that this drop target accepts. Use typeFromName() to get GType values (e.g., typeFromName("gchararray") for strings).
onDrop()?
optionalonDrop: (value,x,y) =>boolean
Defined in: types.ts:89
Called when content is dropped on the widget.
Parameters
| Parameter | Type | Description |
|---|---|---|
value | Value | The dropped value (use value.getTypeName() to check type, then extract) |
x | number | X coordinate of drop |
y | number | Y coordinate of drop |
Returns
boolean
true if the drop was accepted
onDropEnter()?
optionalonDropEnter: (x,y) =>DragAction
Defined in: types.ts:96
Called when a drag enters the widget bounds.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | X coordinate |
y | number | Y coordinate |
Returns
DragAction
The preferred action, or 0 to reject
onDropLeave()?
optionalonDropLeave: () =>void
Defined in: types.ts:100
Called when a drag leaves the widget bounds.
Returns
void
onDropMotion()?
optionalonDropMotion: (x,y) =>DragAction
Defined in: types.ts:107
Called when a drag moves within the widget bounds.
Parameters
| Parameter | Type | Description |
|---|---|---|
x | number | X coordinate |
y | number | Y coordinate |
Returns
DragAction
The preferred action, or 0 to reject