Skip to Main Content
Volume 7A: XView Programming Manual
book

Volume 7A: XView Programming Manual

by Dan Heller
October 1994
Intermediate to advanced content levelIntermediate to advanced
770 pages
22h 58m
English
O'Reilly Media, Inc.
Content preview from Volume 7A: XView Programming Manual
Example 19-1. Sourcing a drag (continued)
if (dragging && drag_pixels++ == 5) {
xv_set(frame, FRAME_LEFT_FOOTER, "Drag and Drop:", 0);
switch (dnd_send_drop(dnd)) {
case XV_OK:
xv_set(frame, FRAME_LEFT_FOOTER,
"Drag and Drop: Began", 0);
break;
case DND_TIMEOUT:
xv_set(frame, FRAME_LEFT_FOOTER,
"Drag and Drop: Timed Out",0);
break;
case DND_ILLEGAL_TARGET:
xv_set(frame, FRAME_LEFT_FOOTER,
"Drag and Drop: Illegal Target",0);
break;
case DND_SELECTION:
xv_set(frame, FRAME_LEFT_FOOTER,
"Drag and Drop: Bad Selection",0);
break;
case DND_ROOT:
xv_set(frame, FRAME_LEFT_FOOTER,
"Drag and Drop: Root Window",0);
break;
case XV_ERROR:
xv_set(frame, FRAME_LEFT_FOOTER,
"Drag and Drop: Failed",0);
break;
}
drag_pixels = 0;
}
}
break;
}
}
PaintObject(object, win, dpy)
DragObject object;
Window win;
Display *dpy;
{
static GC gc;
static int gcCreated = False;
if (!gcCreated) {
XGCValues gcv;
gcv.stipple = (Pixmap) xv_get(object.image, XV_XID);
gcv.fill_style = FillStippled;
gc = XCreateGC(dpy, win, GCStipple|GCForeground|GCBackground|
GCFillStyle, &gcv);
XSetForeground(dpy, gc, BlackPixel(dpy, XDefaultScreen(dpy)));
XSetBackground(dpy, gc, WhitePixel(dpy, XDefaultScreen(dpy)));
}
if (object.inverted) {
XSetFillStyle(dpy, gc, FillSolid);
448 XView Programming Manual
Example 19-1. Sourcing a drag (continued)
XDrawRectangle(dpy, win, gc, object.x-1
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 6A: Motif Programming Manual

Volume 6A: Motif Programming Manual

David Brennan, Dan Heller, Paula Ferguson
Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Java™ Media APIs: Cross-Platform Imaging, Media, and Visualization

Alejandro Terrazas, John Ostuni, Michael Barlow

Publisher Resources

ISBN: 9780937175873