Skip to Main Content
Volume 6A: Motif Programming Manual
book

Volume 6A: Motif Programming Manual

by David Brennan, Dan Heller, Paula Ferguson
September 1993
Intermediate to advanced content levelIntermediate to advanced
1014 pages
28h 26m
English
O'Reilly Media, Inc.
Content preview from Volume 6A: Motif Programming Manual
else {
newTargets = (Atom *) XtMalloc
(sizeof (Atom) * (numExportTargets + 2));
for (m = 0; m < numExportTargets; m++)
newTargets[m] = exportTargets[m];
newTargets[m] = FILE_CONTENTS;
newTargets[m+1] = FILE_NAME;
XtSetArg (args[n], XmNexportTargets, newTargets); n++;
XtSetArg (args[n], XmNnumExportTargets, numExportTargets + 2); n++;
}
/* modify other DragContext resources */
XtSetArg (args[n], XmNblendModel, XmBLEND_JUST_SOURCE); n++;
XtSetArg (args[n], XmNcursorBackground, bg); n++;
XtSetArg (args[n], XmNcursorForeground, fg); n++;
XtSetArg (args[n], XmNsourceCursorIcon, drag_icon); n++;
XtSetArg (args[n], XmNdragOperations, XmDROP_COPY); n++;
XtSetArg (args[n], XmNconvertProc, NewConvertProc); n++;
XtSetArg (args[n], XmNclientData, widget); n++;
XtSetValues (dc, args, n);
XtAddCallback (dc, XmNdragDropFinishCallback, DragDropFinish, NULL);
}
This routine performs many of the same tasks as the StartDrag() action routine, such as accessing the appropriate
structure in the files array and creating a DragIcon for the source icon. The main difference is that we use
XmGetDragContext() to retrieve the current DragContext object, rather than creating one using
XmStartDrag().
The routine retrieves the values of the XmN-exportTargets, XmN-numExportTargets, and
XmN-convertProc resources using XtGetValues() so that it can preserve the existing functionality. The
appropriate new targets are added to the list of targets based on the type of the file, and XmN-exportTargets is set
to the new list. ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Volume 7A: XView Programming Manual

Volume 7A: XView Programming Manual

Dan Heller

Publisher Resources

ISBN: 9780596000431