menubar demo/tutorial

william griffin bill at igame3d.com
Mon Aug 2 13:59:51 EDT 2004


>
>    1. Re: menubar demo/tutorial anyone? (Meitnik at aol.com)
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Mon, 2 Aug 2004 12:16:33 EDT
> From: Meitnik at aol.com
> Subject: Re: menubar demo/tutorial anyone?
> To: use-revolution at lists.runrev.com
> Message-ID: <b7.43a0e434.2e3fc2e1 at aol.com>
> Content-Type: text/plain; charset="US-ASCII"
>
> Hi, I have been searching for a well done menubar teaching stack? Any 
> one
> have one, or have a stack to share that I can study. The revmenubar is 
> more
> complex than I need.
>
> Thanks,
> Andrew

Since I've run into a bug creating the most ludicrously overflowing rev 
breaking menuBar in recorded
history, and my spam blocker had me off the list for awhile these seems 
like a good time and place
for me to jump back into things.

It would help if i knew what you were trying to accomplish of course, 
but here is the simple system.
Menu Builder, add items, generate the skeleton of the button scripts 
with that provided button, then
edit the script and fill in the needed data between the cases.

Script By Hand: Single Menu Items

on menuPick myPick
switch myPick
case "Open"
answer file "Pick some file"
if it is not empty then
put it into myFile
open file myFile for read
   read from file myFile until eof
   put it into field 1
end if
break
end switch
end menuPick

the pattern follows for all other options, after two or three of those 
you've got it down to a science.

Script by hand: Multiple items/sub items
Lets say we have an item we want as sub menu, we'll put it into a 
button called myMenu of our menuBar group called "myMainMenu", you do 
this

put "toplevel menu" & return & tab & "second level" into cd btn 
"myMenu" of group "myMainMenu"

to add a third level of menu into that same button works like this
put "toplevel menu" & return & tab & "second level" & return & tab & 
tab & "third level" into cd btn "myMenu" of group "myMainMenu"

Now to pick from this you would use this process.

on menuPick myPick1 myPick2
put myPick1 & myPick2 into myRealPick
--- a multi level menu pick of this button would produce "toplevel menu 
| second level menu | third level"
--- I've added space so you can see the bar character which denotes the 
items picked
switch  myRealPick
case "toplevel menu|second level menu|third level"
---do something with your item picked
---I've not found a way of picking the top two levels in a button like 
this, seems you must pick the final sub item
break
end switch
end menuPick

OK hope that helps, if you run into trouble just shout.

Mr Bill



More information about the use-livecode mailing list