@gtkx/react / GtkDragSourceProps
Interface: GtkDragSourceProps
Defined in: packages/react/src/generated/jsx.ts:9801
Props for the GtkDragSource controller element.
Extends
Properties
actions?
optionalactions?:DragAction
Defined in: packages/react/src/generated/jsx.ts:9808
The actions that are supported by drag operations from the source.
Note that you must handle the DragSource.:drag-end signal if the actions include %GDK_ACTION_MOVE.
button?
optionalbutton?:number
Defined in: packages/react/src/generated/jsx.ts:10229
Mouse button number to listen to, or 0 to listen for any button.
Inherited from
children?
optionalchildren?:ReactNode
Defined in: packages/react/src/generated/jsx.ts:9797
Inherited from
GtkGestureSingleProps.children
content?
optionalcontent?:ContentProvider|null
Defined in: packages/react/src/generated/jsx.ts:9810
The data that is offered by drag operations from this source.
exclusive?
optionalexclusive?:boolean
Defined in: packages/react/src/generated/jsx.ts:10235
Whether the gesture is exclusive.
Exclusive gestures only listen to pointer and pointer emulated events.
Inherited from
GtkGestureSingleProps.exclusive
icon?
optionalicon?:Paintable|null
Defined in: packages/react/src/jsx.ts:1012
Paintable to use as the drag icon
iconHotX?
optionaliconHotX?:number
Defined in: packages/react/src/jsx.ts:1014
X offset of the hotspot within the drag icon
iconHotY?
optionaliconHotY?:number
Defined in: packages/react/src/jsx.ts:1016
Y offset of the hotspot within the drag icon
name?
optionalname?:string|null
Defined in: packages/react/src/generated/jsx.ts:9764
The name for this controller, typically used for debugging purposes.
Inherited from
nPoints?
optionalnPoints?:number
Defined in: packages/react/src/generated/jsx.ts:10101
The number of touch points that trigger recognition on this gesture.
Inherited from
onBegin?
optionalonBegin?: (sequence,self) =>void|null
Defined in: packages/react/src/generated/jsx.ts:10113
Emitted when the gesture is recognized.
This means the number of touch sequences matches Gesture.n-points.
Note: These conditions may also happen when an extra touch (eg. a third touch on a 2-touches gesture) is lifted, in that situation sequence won't pertain to the current set of active touches, so don't rely on this being true.
Parameters
| Parameter | Type |
|---|---|
sequence | EventSequence |
self | Gesture |
Returns
void | null
Inherited from
onCancel?
optionalonCancel?: (sequence,self) =>void|null
Defined in: packages/react/src/generated/jsx.ts:10126
Emitted whenever a sequence is cancelled.
This usually happens on active touches when EventController.reset is called on gesture (manually, due to grabs...), or the individual sequence was claimed by parent widgets' controllers (see Gesture.set_sequence_state).
gesture must forget everything about sequence as in response to this signal.
Parameters
| Parameter | Type |
|---|---|
sequence | EventSequence |
self | Gesture |
Returns
void | null
Inherited from
GtkGestureSingleProps.onCancel
onDragBegin?
optionalonDragBegin?: (drag,self) =>void|null
Defined in: packages/react/src/generated/jsx.ts:9817
Emitted on the drag source when a drag is started.
It can be used to e.g. set a custom drag icon with DragSource.set_icon.
Parameters
| Parameter | Type |
|---|---|
drag | Drag |
self | DragSource |
Returns
void | null
onDragCancel?
optionalonDragCancel?: (drag,reason,self) =>boolean|null
Defined in: packages/react/src/generated/jsx.ts:9825
Emitted on the drag source when a drag has failed.
The signal handler may handle a failed drag operation based on the type of error. It should return %TRUE if the failure has been handled and the default "drag operation failed" animation should not be shown.
Parameters
| Parameter | Type |
|---|---|
drag | Drag |
reason | DragCancelReason |
self | DragSource |
Returns
boolean | null
onDragEnd?
optionalonDragEnd?: (drag,deleteData,self) =>void|null
Defined in: packages/react/src/generated/jsx.ts:9833
Emitted on the drag source when a drag is finished.
A typical reason to connect to this signal is to undo things done in DragSource.:prepare or DragSource.:drag-begin handlers.
Parameters
| Parameter | Type |
|---|---|
drag | Drag |
deleteData | boolean |
self | DragSource |
Returns
void | null
onEnd?
optionalonEnd?: (sequence,self) =>void|null
Defined in: packages/react/src/generated/jsx.ts:10138
Emitted when gesture either stopped recognizing the event sequences as something to be handled, or the number of touch sequences became higher or lower than Gesture.n-points.
Note: sequence might not pertain to the group of sequences that were previously triggering recognition on gesture (ie. a just pressed touch sequence that exceeds Gesture.n-points). This situation may be detected by checking through Gesture.handles_sequence.
Parameters
| Parameter | Type |
|---|---|
sequence | EventSequence |
self | Gesture |
Returns
void | null
Inherited from
onNotify?
optionalonNotify?: (pspec,self) =>void|null
Defined in: packages/react/src/generated/jsx.ts:9796
The notify signal is emitted on an object when one of its properties has its value set through g_object_set_property(), g_object_set(), et al.
Note that getting this signal doesn’t itself guarantee that the value of the property has actually changed. When it is emitted is determined by the derived GObject class. If the implementor did not create the property with %G_PARAM_EXPLICIT_NOTIFY, then any call to g_object_set_property() results in ::notify being emitted, even if the new value is the same as the old. If they did pass %G_PARAM_EXPLICIT_NOTIFY, then this signal is emitted only when they explicitly call g_object_notify() or g_object_notify_by_pspec(), and common practice is to do that only when the value has actually changed.
This signal is typically used to obtain change notification for a single property, by specifying the property name as a detail in the g_signal_connect() call, like this:
|[ g_signal_connect (text_view->buffer, "notify::paste-target-list", G_CALLBACK (gtk_text_view_target_list_notify), text_view) ]|
It is important to note that you must use [canonical parameter names]GObjectParamSpec#parameter-names as detail strings for the notify signal.
Parameters
| Parameter | Type |
|---|---|
pspec | ParamSpec |
self | EventController |
Returns
void | null
Inherited from
GtkGestureSingleProps.onNotify
onPrepare?
optionalonPrepare?: (x,y,self) =>ContentProvider|null
Defined in: packages/react/src/generated/jsx.ts:9842
Emitted when a drag is about to be initiated.
It returns the GdkContentProvider to use for the drag that is about to start. The default handler for this signal returns the value of the DragSource.content property, so if you set up that property ahead of time, you don't need to connect to this signal.
Parameters
| Parameter | Type |
|---|---|
x | number |
y | number |
self | DragSource |
Returns
ContentProvider | null
onSequenceStateChanged?
optionalonSequenceStateChanged?: (sequence,state,self) =>void|null
Defined in: packages/react/src/generated/jsx.ts:10145
Emitted whenever a sequence state changes.
See Gesture.set_sequence_state to know more about the expectable sequence lifetimes.
Parameters
| Parameter | Type |
|---|---|
sequence | EventSequence |
state | EventSequenceState |
self | Gesture |
Returns
void | null
Inherited from
GtkGestureSingleProps.onSequenceStateChanged
onUpdate?
optionalonUpdate?: (sequence,self) =>void|null
Defined in: packages/react/src/generated/jsx.ts:10151
Emitted whenever an event is handled while the gesture is recognized.
sequence is guaranteed to pertain to the set of active touches.
Parameters
| Parameter | Type |
|---|---|
sequence | EventSequence |
self | Gesture |
Returns
void | null
Inherited from
GtkGestureSingleProps.onUpdate
propagationLimit?
optionalpropagationLimit?:PropagationLimit
Defined in: packages/react/src/generated/jsx.ts:9766
The limit for which events this controller will handle.
Inherited from
GtkGestureSingleProps.propagationLimit
propagationPhase?
optionalpropagationPhase?:PropagationPhase
Defined in: packages/react/src/generated/jsx.ts:9768
The propagation phase at which this controller will handle events.
Inherited from
GtkGestureSingleProps.propagationPhase
ref?
optionalref?:Ref<DragSource>
Defined in: packages/react/src/generated/jsx.ts:9843
Overrides
touchOnly?
optionaltouchOnly?:boolean
Defined in: packages/react/src/generated/jsx.ts:10237
Whether the gesture handles only touch events.