
3
Creating XView Applications
This chapter covers the XView programming interface. It describes the basic XView distri-
bution and how you use it to compile and link XView applications. It also presents the
proper structure for XView applications. The structure can be summarized as:
• Initialize XView using xv_init().
• Create a top-level window (FRAME) to manage subwindows.
• Add subwindows as children of the FRAME.
• Add objects to subwindows.
• Specify notification callbacks and select input events.
• Call xv_main_loop() to start the dispatching of events.
This chapter also discusses error recovery procedures.
3.1 Interface Overview
This section gives an overview of the XView programming interface. It covers reserved
words and naming conventions in XView. It also includes a complete sample program,
which we will look at more closely when describing the calling sequence for a program.
3.1.1 Compiling XView Programs
To compile an XView program, you must link with the XView library and the
OPEN LOOK
graphics library. These libraries comprise the entire XView Toolkit. XView is written for
X11, of course, so you need to add the standard X library, which contains all the Xlib rou-
tines.
Thus, to compile a typical XView application whose source is myprog.c, you use the com-
mand:
% cc myprog.c –lxview –lolgx –lX11 –o myprog
Creating XView
Applications
Creating XView Applications 41