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 25-3. The image.c program
/* image.c -- demonstrate the use of the image package. */
#include <xview/xview.h>
#include "image.h"
main(argc, argv)
int argc;
char *argv[ ];
{
Frame frame;
Image image1, image2;
Pixmap pixmap;
xv_init(XV_INIT_ARGC_PTR_ARGV, &argc, argv, NULL);
if (argc < 2)
puts("specify filename"), exit(1);
/* frame = (Frame)xv_create(NULL, FRAME, NULL); */
if (!(image1 = xv_create(NULL, IMAGE,
XV_WIDTH, 100,
XV_HEIGHT, 100,
SERVER_IMAGE_BITMAP_FILE, argv[1],
NULL)))
puts("unsuccessfully created image1"), exit(1);
if (!(image2 = xv_find(NULL, IMAGE,
SERVER_IMAGE_BITMAP_FILE, argv[1],
NULL)))
puts("unsuccessfully created image2"), exit(1);
printf("image1 %s image2\n",
(image2 != image1)? "matched" : "didn’t match");
pixmap = (Pixmap)xv_get(image1, SERVER_IMAGE_PIXMAP);
if (!(image2 = xv_find(NULL, IMAGE,
SERVER_IMAGE_PIXMAP, pixmap,
NULL)))
puts("unsuccessfully created image2"), exit(1);
printf("image1 %s image2\n",
(image2 != image1)? "matched" : "didn’t match");
/* window_fit(frame); */
/* xv_main_loop(frame); */
}
XView Internals
XView Internals 619
25.11 The Wizzy Package—A Panel Item Extension
This section presents an implementation for a panel item extension. This package is called
the Wizzy package; this example does not actually do anything but is presented to show how
to make extensions
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