5 The Main Window
This chapter describes the Motif MainWindow widget, which can be used to frame many types of applications. The
MainWindow is a manager widget that provides a menu bar, a scrollable work area, and various other optional display
and control areas.
As discussed in Chapter 3, Overview of the Motif Toolkit, the main window of an application is the most visible and
the most used of all the windows in an application. It is the focal point of the user's interactions with the program, and
it is typically the place where the application provides most of its visual feedback. To encourage consistency across
the desktop, the Motif Style Guide suggests a generic main window layout, which can vary from application to
application, but is generally followed by most Motif applications. Such a layout is shown in the figure. As described
in Section #smainwindow, a main window can provide a menu bar, a work area, horizontal and vertical scrollbars, a
command area, and a message area.
The main window of a Motif program
In an effort to facilitate the task of building a main window, the Motif toolkit provides the MainWindow widget. This
widget supports the different areas of the generic main window layout. However, the MainWindow widget is not the
only way to handle the layout of the main window of your application. You are not required to use the MainWindow
widget and you should not feel that you need to follow the Motif specifications to the letter. While the Style Guide
81
Get Volume 6A: Motif Programming Manual now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.