Next Previous Up Top Contents Index

6 Using Command Tables

6.4 Including command tables in frame definitions

In the previous section, you defined four command tables: one for each menu in the task list manager. Next, you need to combine these command tables and include them in the definition of the <task-frame>. The way to do this is to define an additional command table which has each of the other command tables as its components, and then supply this command table as an option in the definition of <task-frame>.

define command-table *task-list-command-table* 
    (*global-command-table*)
  menu-item "File" = *file-command-table*;
  menu-item "Edit" = *edit-command-table*;
  menu-item "Task" = *task-command-table*;
  menu-item "Help" = *help-command-table*;
end command-table *task-list-command-table*

Just like the menu commands in each menu, every menu in the menu bar is defined as a menu item in the definition of the command table.

You can add a command table to the definition of a frame class in much the same way as you add a layout, tool bar, status bar, or menu bar, using the command-table option. In the definition of <task-frame>, replace the line that reads:

menu-bar (frame) frame.task-menu-bar;

with

command-table (frame) *task-list-command-table*;

A complete listing of the implementation of <task-frame> using command tables is given in Appendix A, "Source Code For The Task List Manager".


Building Applications Using DUIM - 26 May 1999

Next Previous Up Top Contents Index