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 20-1. The animate.c program (continued)
panel = (Panel)xv_create(frame, PANEL,
PANEL_LAYOUT, PANEL_VERTICAL,
NULL);
xv_create(panel, PANEL_BUTTON,
PANEL_LABEL_STRING, "Quit",
PANEL_NOTIFY_PROC, exit,
NULL);
xv_create(panel, PANEL_SLIDER,
PANEL_LABEL_STRING, "Millisecs Between Frames",
PANEL_VALUE, 0,
PANEL_MAX_VALUE, 120,
PANEL_NOTIFY_PROC, adjust_speed,
NULL);
xv_create(panel, PANEL_CHOICE,
PANEL_LABEL_STRING, "Glyphs",
PANEL_LAYOUT, PANEL_HORIZONTAL,
PANEL_DISPLAY_LEVEL, PANEL_ALL,
PANEL_CHOICE_STRINGS, "Horse", "Man", "Boy", "Eye", NULL,
PANEL_NOTIFY_PROC, change_glyph,
NULL);
window_fit(panel);
canvas = (Canvas)xv_create(frame, CANVAS,
XV_WIDTH, 64,
XV_HEIGHT, 64,
CANVAS_X_PAINT_WINDOW, TRUE,
NULL);
canvas_win = (Window)xv_get(canvas_paint_window(canvas), XV_XID);
window_fit(frame);
dpy = (Display *)xv_get(frame, XV_DISPLAY);
_font = (Xv_Font)xv_find(frame, FONT,
FONT_NAME, "icon",
NULL);
font = (XFontStruct *)xv_get(_font, FONT_INFO);
gcvalues.font = font->fid;
gcvalues.foreground = BlackPixel(dpy, DefaultScreen(dpy));
gcvalues.background = WhitePixel(dpy, DefaultScreen(dpy));
gcvalues.graphics_exposures = False;
gc = XCreateGC(dpy, RootWindow(dpy, DefaultScreen(dpy)),
GCForeground | GCBackground | GCFont | GCGraphicsExposures,
&gcvalues);
xv_main_loop(frame);
}
void
change_glyph(item, value)
Panel_item item;
int value;
{
cnt = 0;
if (value == 0) {
max_images = ArraySize(horses);
Notifier
The Notifier 469
Example 20-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