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 12-6. The notice.c program (continued)
xv_set(panel, PANEL_LAYOUT, PANEL_HORIZONTAL, NULL);
(void) xv_create(panel, PANEL_BUTTON,
PANEL_LABEL_STRING, "Commit...",
PANEL_NOTIFY_PROC, my_notify_proc,
XV_KEY_DATA, MSG_ITEM, msg_item,
/*
* attach a prompt specific for this button used by
* notices
*/
XV_KEY_DATA, NOTICE_PROMPT, "Update all changes?",
/*
* Note there is no callback func here, but one could be
* written
*/
NULL);
window_fit(panel);
window_fit(frame);
xv_main_loop(frame);
}
/*
* my_notify_proc()
* The "key data" associated with the panel item is extracted via
* xv_get(). The resulting choice is displayed in the panel
* message item.
*/
Xv_opaque
my_notify_proc(item, event)
Panel_item item;
Event *event;
{
int result;
int (*func)();
char *prompt;
Panel_item msg_item;
Panel panel;
static Xv_notice notice = NULL;
func = (int(*)())xv_get(item, XV_KEY_DATA, CALLBACK_FUNC);
prompt = (char *)xv_get(item, XV_KEY_DATA, NOTICE_PROMPT);
msg_item = (Panel_item)xv_get(item, XV_KEY_DATA, MSG_ITEM);
panel = (Panel)xv_get(item, PANEL_PARENT_PANEL);
/*
* Create the notice and get a response.
*/
if (!notice) {
notice = xv_create(panel, NOTICE,
NOTICE_LOCK_SCREEN, TRUE,
NOTICE_STATUS, &result,
XV_SHOW, TRUE,
NOTICE_MESSAGE_STRINGS,
prompt,
"Press YES to confirm",
"Press NO to cancel",
NULL,
322 XView Programming Manual
Example 12-6. ...
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