next up previous contents
Next: Toolbar Modules Up: GUI Implementation Previous: Overview of the Implementation

Pull-Down Menu Modules

The modules responsible for implementing the pull-down menu and the options that appear in its submenus are presented in Table 3.1. The use of the menubutton and menu widgets facilitated the creation of the pull-down menu. The procedure dispatch mechanism is incorporated as a configuration option to entries added to the menu widget.

 

 
Module Name Purpose
about.tcl Display a top-level dialog box containing the name and version information of the application. Employed by the Help | About pull-down menu option.
configure.tcl Displays a dialog box which lets the user configure various aspects of the GUI. Employed by the File | Configure... pull-down menu option.
debugging.tcl Contains procedures used to help in the debugging and verification of various aspects of the GUI. These procedures are accessible via the Debugging submenu of the pull-down menu.
file.tcl Contains procedures which implement several of the file related features of the File submenu of the pull-down menu.
pullmenu.tcl Procedures responsible for the construction and manipulation of the toplevel pull-down menuing system.
Table 3.1: Pull-down Menu Module Responsibilities

The pull-down menu user interface component is created by the pullmenu_create procedure of the pullmenu.tcl module. This procedure is generic enough to make the creation and subsequent modification of the menu bar and its corresponding pull-down menus relatively simple. An example of the invocation of this procedure is shown in Figure 3.2. This procedure accepts one list for each pull-down menu to be created. Each list is comprised of the name of the menu button, the location of the menu button along the menu bar (either right or left) and a list of menu entries which are to be displayed in the corresponding pull-down menu. Each of these entries are sublists which contain the necessary information to create the menu entry.

   figure1449
Figure 3.2: Invoking the pullmenu_create Procedure

Note that the ampersand, &, may be used to indicate which character will be underlined in the text of the menu entry. This character becomes a hot key for that menu entry. Menu entries along the menu bar can be accessed by pressing Alt and the menu's corresponding hot key, thereby displaying the appropriate pull-down menu. An entry in a pull-down menu can be invoked by simply pressing the hot key corresponding to that entry. For example, the key sequence Alt+ F X will terminate the application. The vertical bar, |, is used to separate submenu entries from their corresponding accelerator key sequence. This sequence enables the user to invoke a feature immediately, bypassing the pull-down menu system altogether. For example, Ctrl+ X will also terminate the application, but with one less key stroke than using the hot key sequence mentioned above.

Pull-down menu entries are not restricted to executing commands or procedures as implied by the figure. Entries may have radio- or check-buttons associated with them, thereby maintaining state information, or they may invoke other submenus (known as cascades), which offer more choices to the user when activated.


next up previous contents
Next: Toolbar Modules Up: GUI Implementation Previous: Overview of the Implementation

Donald Craig
Mon Jul 8 12:05:35 NDT 1996