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 7-7. The panel_repaint.c program (continued)
#define PANEL_GC_KEY 101 /* any arbitrary number */
main(argc, argv)
int argc;
char *argv[ ];
{
Display *display;
Frame frame;
Panel panel;
int quit();
void panel_repaint();
XGCValues gcvalues;
Server_image grey;
Mask gcmask = 0L;
GC gc;
xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
frame = (Frame)xv_create(XV_NULL, FRAME, NULL);
panel = (Panel)xv_create(frame, PANEL,
PANEL_REPAINT_PROC, panel_repaint,
NULL);
(void) xv_create(panel, PANEL_BUTTON,
PANEL_LABEL_STRING, "Quit",
PANEL_NOTIFY_PROC, quit,
PANEL_CLIENT_DATA, frame,
NULL);
window_fit(frame);
grey = (Server_image)xv_create(NULL, SERVER_IMAGE,
XV_WIDTH, gray1_width,
XV_HEIGHT, gray1_height,
SERVER_IMAGE_DEPTH, 1, /* clarify for completeness*/
SERVER_IMAGE_BITS, gray1_bits,
NULL);
display = (Display *)xv_get(panel, XV_DISPLAY);
gcvalues.stipple = (Pixmap) xv_get(grey, XV_XID);
gcvalues.fill_style = FillOpaqueStippled;
gcvalues.plane_mask = 1L;
gcvalues.graphics_exposures = False;
gcvalues.foreground = BlackPixel(display, DefaultScreen(display));
gcvalues.background = WhitePixel(display, DefaultScreen(display));
gcmask = GCStipple | GCFillStyle | GCPlaneMask |
GCGraphicsExposures | GCForeground | GCBackground;
gc = XCreateGC(display, xv_get(panel, XV_XID), gcmask, &gcvalues);
/* attach the GC to the panel for use by the repaint proc above */
xv_set(panel, XV_KEY_DATA, PANEL_GC_KEY, gc, NULL);
xv_main_loop(f
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