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
The widget passed to the callback routine is the DragContext object for the drag and drop transfer. The routine
retrieves the source icon from the DragContext and destroys it using XtDestroyWidget().
19.5 Working With Drop Sites
In order to handle data from drag sources that provide something other than textual data, an application has to register
drop sites that understand other types of data. To make the file_manager.c application useful, we need an application
that has drop sites that can handle file objects. In this section, we are going to modify the text editor from Chapter 14,
Text Widgets, so that it understands file data. The application contains two drop sites that handle files: the main text
entry area and a filename status area. the source code shows the main(), HandleDropLabel(),
HandleDropText(), and TransferProc() routines for editor_dnd.c. The rest of the routines in the application
are the same as in Section #stexteditor, so we have not shown them here.
/* editor_dnd.c −− create an editor application that contains drop sites
* that understand file data. A file can be dragged from another
* application and dropped in the text entry area or the filename status
* area.
*/
#include <Xm/Text.h>
#include <Xm/TextF.h>
#include <Xm/LabelG.h>
#include <Xm/PushBG.h>
#include <Xm/RowColumn.h>
#include <Xm/MainW.h>
#include <Xm/Form.h>
#include <Xm/FileSB.h>
#include <Xm/SeparatoG.h>
#include <Xm/DragDrop.h>
#include <X11/Xos.h>
#include <stdio.h>
#include <sys/types.h>
#include ...
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