Skip to Main Content
Volume 6A: Motif Programming Manual
book

Volume 6A: Motif Programming Manual

by David Brennan, Dan Heller, Paula Ferguson
September 1993
Intermediate to advanced content levelIntermediate to advanced
1014 pages
28h 26m
English
O'Reilly Media, Inc.
Content preview from Volume 6A: Motif Programming Manual
28.2 A Bitmap Display Utility
The xshowbitmap program is a useful utility for reviewing a group of bitmap files. The filenames for the bitmaps can
be specified on the command line, sent through a pipe, or typed into stdin. All of the bitmaps are drawn into a
pixmap, which is rendered into a DrawingArea widget. The DrawingArea is used as the work window for a
ScrolledWindow, so that we can demonstrate application−defined scrolling for the Motif ScrolledWindow. The
bitmaps are displayed in an equal number of rows and columns if possible. Alternatively, you can specify either the
number of rows or the number of columns using the −rows or −columns command−line option, respectively.
The example in the source code demonstrates the use of Xt mechanisms for adding command−line options and
application−level resources in an application. For an explanation of these Xt features, see Volume Four, X Toolkit
Intrinsics Programming Manual. For details on the Xlib functions for reading and manipulating bitmaps, see
Volume One, Xlib Programming Manual. XtSetLanguageProc() is only available in X11R5; there is no
corresponding function in X11R4.
/* xshowbitmap.c −− displays a set of bitmaps specified on the command
* line, from a pipe, or typed into stdin. Bitmaps must be specified
* as file names.
*
* Usage: xshowbitmap
* −s sorts the bitmaps in order of size with largest first
* −v verbose mode for when input is redirected to stdin
* −w width of viewport window
* −h height of viewport window
* −fg foreground ...
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 7A: XView Programming Manual

Volume 7A: XView Programming Manual

Dan Heller

Publisher Resources

ISBN: 9780596000431