menubuilding

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

Post Reply
robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

menubuilding

Post by robm80 » Sat May 24, 2014 6:12 am

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

Klaus
Posts: 14205
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: menubuilding

Post by Klaus » Sat May 24, 2014 11:33 am

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? 8)

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! 8)


Best

Klaus

robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

Re: menubuilding

Post by robm80 » Sat May 24, 2014 1:42 pm

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

Klaus
Posts: 14205
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: menubuilding

Post by Klaus » Sat May 24, 2014 1:49 pm

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

robm80
Posts: 161
Joined: Sat May 03, 2014 7:15 am

Re: menubuilding

Post by robm80 » Sat May 24, 2014 2:24 pm

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:
pref.jpg
like this

Klaus
Posts: 14205
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Re: menubuilding

Post by Klaus » Sat May 24, 2014 2:32 pm

Dag Rob,

as you might have guessed, the LC "preferences" and "About" dialogs are just STACKS! 8)

So create YOUR "preferences" and "about" sub-stack and display them when the user
selects the appropriate menu items :D


Best

Klaus

Post Reply