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-4. Sample reply procedure
SelectionReplyProc (continued)
if (target == ATOM(server, "STRING")) {
static int incr = False;
if (type == ATOM(server, "INCR")) {
textsw_insert(textsw, "Contents of the selection:\n", 27);
incr = True;
}
else
if (length) {
if (!incr)
textsw_insert(textsw, "Contents of the selection:\n", 27);
textsw_insert(textsw, (char *)value, length);
textsw_insert(textsw, "\n", 1);
}
else
incr = False;
}
else
if (target == ATOM(server, "DELETE")) {
textsw_insert(textsw, "The Selection has been deleted\n", 31);
}
textsw_insert(textsw, LINE, strlen(LINE));
}
18.2.5.1 Handling selection reply procedure errors
If the selection conversion fails, and you are using a non-blocking request, the reply proce-
dure is called with replyValue set to an error code and length set to SEL_ERROR. The reply
procedure error codes are defined in sel_pkg.h and shown in Table 18-2.
If the selection conversion fails, and you are using a blocking request without a reply proce-
dure defined, the xv_get() returns with the length argument set to SEL_ERROR, format set
to 0, and a NULL value is returned. If a reply procedure is defined, its replyValue argument is
set to one of the error codes shown in Table 18-2.
Table 18-2. Error Codes
Code Description
SEL_BAD_CONVERSION If the conversion is refused by the selection holder or there
is no holder of the selection, this value is returned. This
may mean that there is no
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