This version of this document is no longer maintained. For the latest documentation, see http://www.qnx.com/developers/docs. |
Initiate a drag-and-drop operation
int PtInitDnd( PtTransportCtrl_t *ctrl, PtWidget_t *widget, PhEvent_t *event, PhDndCursors_t *cursors, int unsigned flags );
PhDndCursors_t contains three members, all pointers to PhCursorDescription_t, which describe the cursor's appearance when performing a drag-and-drop operation:
typedef struct Ph_ev_dndrop_cursors { const PhCursorDescription_t *active, *inactive, *unknown; } PhDndCursors_t;
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.
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, cbinfo->event, NULL, Pt_DND_LOCAL | Pt_DND_SILENT ); return Pt_CONTINUE; }
Photon
Safety: | |
---|---|
Interrupt handler | No |
Signal handler | No |
Thread | No |
PhCursorDescription_t, PhEvent_t, PtCancelDnd(), PtCreateTransportCtrl(), PtDndFetch_t, PtDndSelect(), PtTransportCtrl_t, PtTransportType()
Drag and Drop chapter of the Photon Programmer's Guide