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 18-11. Sample conversion procedure
SelectionConvertProc (continued)
} else
/* Call the default selection conversion procedure.
* It handles requests for any pre-registered
* conversions, including TARGETS.
*/
return(sel_convert_proc(sel, target, data, length, format));
}
18.8.1 The Done Procedure
The selection done procedure is called after each conversion has happened. This gives the
application a chance to free up memory.
void
SelectionDoneProc(sel, data, target)
Selection_owner sel;
Xv_opaque data;
Atom target;
{
if (target == ATOM(server, "STRING"))
free((char *)data);
}
Note, in this example, we only alloc data for string requests so we only free it for string data.
18.8.2 The Lose Procedure
The lose procedure lets the selection package lose ownership a selection gracefully. For
example, the user can can be informed that the selection was lost, as in the following
example.
void
SelectionLoseProc(sel)
Selection_owner sel;
{
xv_set(frame, FRAME_LEFT_FOOTER, "Lost Selection...", NULL);
}
Selections
Selections 423
18.9 Sample Selection Requestor Program
Example 18-12 shows three panel items that are created to handle the selection rank, the tar-
get(s) request, and initiating the request. Below them is a textsw that displays the response
to the request.
Example 18-12. Sample selection requestor program
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