next up previous contents
Next: Check Lists Up: Tina Windows Previous: Buttons   Contents

Menu Bars

Motif prefers all menus in a single bar at the top of the program. A menu bar controlling multiple menus can be created with a single call to

tw_menubar(menu_bar_name,
  menu_1_name,
      name1_1, proc1_1, data1_1,
      name1_2, proc1_2, data1_2,
      ...,
      NULL, 
  menu_2_name,
      name2_1, proc2_1, data2_1,
      name2_2, proc2_2, data2_2,
      ...,
      NULL,
  ...,
  NULL);
char *menu_bar_name, *menu_1_name, ..., *name1_1, ... ;
void (*proc1_1)(), (*proc1_2)(), ... ;
void *data1_1, *data1_2, ... ;

This function has a variable length argument list, sensible indentation will help. A menu bar with name menu_bar_name is created, with buttons called menu_1_name, menu_2_name etc. which bring up menus when pressed.

On each menu choosing the entry with a given name calls the associated procedure with the given data as argument. Note each menu is terminated by a NULL argument and the last argument must also be NULL; no names can be NULL pointers (though data items can be).


next up previous contents
Next: Check Lists Up: Tina Windows Previous: Buttons   Contents
root 2017-09-25