Page 1 of 1
menubuilding
Posted: Sat May 24, 2014 6:12 am
by robm80
Why this works:
on menuPick theItem
if theItem is "exit" then close the defaultStack
else if theItem is "save" then save the defaultStack
end menuPick
and this not:
if theItem is "preferences then launch preferences
and the same for about and others.\
and what to do with "save as"
Where can I finf the essentials about menubuilding
Re: menubuilding
Posted: Sat May 24, 2014 11:33 am
by Klaus
Hi Rob,
1. when using "menupick" you better use the SWITCH syntax, easier to mainatin and much more readable:
Code: Select all
on menuPick tItem
switch tItem
case "exit"
close the defaultStack
break
case "save"
save the defaultStack
break
case "copy"
copy
break
##etc...
end switch
end menuPick
2.
if theItem is "preferences then launch preferences
Well, WHAT is "preferences" here?
Is it stack? Is it a file? "launch" is for external files!
In other words, what do you exspect to happen in that case?
3.
Where can I find the essentials about menubuilding
Check the appropriate stack here:
http://www.hyperactivesw.com/revscriptc ... ences.html
The other stacks are not too bad either!
Best
Klaus
Re: menubuilding
Posted: Sat May 24, 2014 1:42 pm
by robm80
Klaus, very good advises!
1. when using "menupick" you better use the SWITCH syntax. OK, done.
2. Well, WHAT is "preferences" here? : I want the optionsmenu as is mostly under EDIT and the same for Help/about.
3.hyperactivesw.com: a nice place to be and veryuseful it seems.
Gdday
Rob
Re: menubuilding
Posted: Sat May 24, 2014 1:49 pm
by Klaus
Dag Rob,
robm80 wrote:2. Well, WHAT is "preferences" here? : I want the optionsmenu as is mostly under EDIT and the same for Help/about.
yes, sure, the menu should be at the correct "position" in the menus.
On the Mac, things are a bit different as you will see, check the stack at the url!
But my actual question is: what should happen when the user selects that menuitem?
Best
Klaus
Re: menubuilding
Posted: Sat May 24, 2014 2:24 pm
by robm80
But my actual question is: what should happen when the user selects that menuitem?
Well the optionsmenu must open like here in the picture; and the same for About:

- like this
Re: menubuilding
Posted: Sat May 24, 2014 2:32 pm
by Klaus
Dag Rob,
as you might have guessed, the LC "preferences" and "About" dialogs are just STACKS!
So create YOUR "preferences" and "about" sub-stack and display them when the user
selects the appropriate menu items
Best
Klaus