Lingo Tutorial: Menus READING: Installing Menus (Chapter 11, pages 390-393 in D8D) File "menus.dir"
See how easy it is to add a menubar in your stand-alone application First, create a field containing your menu contents: menu: @ About... | alert "Made in the USA" menu: File Quit/Q | quit menu: Speed Fast/1 | SetSpeed "Fast" Medium/2 | SetSpeed "Medium" Slow/3 | SetSpeed "Slow" menu: Cast Axe | SetCast "Axe" Bart | SetCast "Bart" Batman | SetCast "Batman" menu: Cursor Crossbar | cursor 3 Crosshair | cursor 2 I-beam | cursor 1 Pointer | cursor -1 Watch | cursor 4 Then, in a movie script install the menu: on startMovie go to "Main Loop" installMenu (the number of cast "MainMenuBar") SetCast "Batman" -- default SetSpeed "Medium" -- default end startMovie --Activated by the menu: These two set-commands change the cast and speed. on SetCast theCast UncheckAll("Cast",3) sprite(2).castNum = cast(theCast).number set the checkMark of menuItem theCast of menu "Cast" = true -- no alternative dot syntax available for the operation above yet: -- menu("Cast").menuItem(theCast).checkmark = true does not work end SetCast
Now the menubar is installed. The rest is done by the HandleChase handler, as before.
|
|
Maintained By: Takis Metaxas
|