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
Atom *, XtPointer *, unsigned long *, int *);
Widget widget;
Atom *selection;
Atom *target;
Atom *type_return;
XtPointer *value_return;
unsigned long *length_return;
int *format_return;
The widget parameter is the DragContext for the drag operation, selection is the selection atom, which in this
case is _MOTIF_DROP, and target is the type of information requested about the selection. The type_return,
value_return, length_return, and format_return parameters return the type, value, length, and format
of the converted data. The routine should return True if the conversion succeeds and False otherwise. For more
information about this procedure type, see Volume Four, X Toolkit Intrinsics Programming Manual, and the
appropriate reference page in Volume Five, X Toolkit Intrinsics Reference Manual.
The ConvertProc() routine in the source code starts by retrieving the Label widget from the XmN-clientData
resource of the DragContext. The goal is to get an index into the files array so that we can access information about
the file. The index is stored in the -XmNuserData resource of the Label widget. Once we have the index, we can
use it to get the filename from the array.
Our conversion routine only handles requests for a filename or the contents of a file. If target is set to
FILE_CONTENTS, ConvertProc() retrieves the contents of the file and formats the data for transfer back to the
receiving client. The contents of the file are passed as a pointer to the text, using the value_return parameter. ...
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