[Next] [Previous] [Up] [Top] [Contents] [Index]
Menus
Adding a menu and a menu-item
To add a menu to the menubar, we create an instance of the class menu, and install it. Because we will want to perform other operations on this menu, we will store it in a variable when we create it.
- Create a menu and add it to the menubar.
Execute the following expressions in the Listener:
(defvar *custom-menu*
(make-instance 'menu
:menu-title "Custom"))
(menu-install *custom-menu*)
- Add a menu-item to the new menu.
Execute the following expression in the Listener:
(add-menu-items
*custom-menu*
(make-instance 'menu-item
:menu-item-title "Echo Window"
:menu-item-action 'make-echo-window))
That's all there is to it. You've now added a menu and a menu-item to your Lisp environment. Try selecting the menu-item, to see that it works.
Gettmg Started with MCL - 19 OCT 1996
[Next] [Previous] [Up] [Top] [Contents] [Index]
Generated with Harlequin WebMaker