![]() |
![]() |
![]() |
![]() |
Initiate a drag-and-drop operation
int PtInitDnd( PtTransportCtrl_t *ctrl, PtWidget_t *widget, PhEvent_t *event, PhDndCursors_t *cursors, int unsigned flags );
ph
This function initiates a drag-and-drop operation with the data previously added to the PtTransportCtrl_t structure pointed to by ctrl. Before calling PtInitDnd(), your application must create this structure by calling PtCreateTransportCtrl() and populate it via calls to PtTransportType() and PtTransportRequestable().
The structure pointed to by ctrl is automatically released at the end of the drag-and-drop operation.
The widget argument specifies the widget on whose behalf the drag-and-drop operation is being started. It's this widget that receives all drag-and-drop progress-notification events and callbacks.
The event argument points to a PhEvent_t structure that describes the event that was used to precipitate the operation.
The cursors argument, if provided, is used instead of the default drag-and-drop cursors (accept, reject, unknown... app not responding) if the destination doesn't override them.
The flags argument is a combination of the following bits:
int cb_outbound (PtWidget_t *widget, void *data, PtCallbackInfo_t *cbinfo); { PtTransportCtrl_t *tctrl = PtCreateTransportCtrl(); PtTransportType( tctrl, "text", "simple sentence", 0, Ph_TRANSPORT_INLINE, "string", "This is my inlined data.", 0, 0 ); PtInitDnd( tctrl, widget, NULL, NULL, Pt_DND_LOCAL | Pt_DND_SILENT ); return Pt_CONTINUE; }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PhEvent_t, PtCancelDnd(), PtCreateTransportCtrl(), PtDndFetch_t, PtDndSelect(), PtTransportCtrl_t, PtTransportType()
Drag and Drop chapter of the Photon Programmer's Guide
![]() |
![]() |
![]() |
![]() |