I am trying to write a program where menus would be read from a file. This could be an XML or CSV file or some other format. I will probably just use XML, but the format isn't important to me. The file would contain menu names and menu item names for each menu name. I want to set up a menu bar and populate the menus and menu items using code. I wouldn't need more than one menu bar. I have figured out how to create a button, but I can't figure out how to create an option control. My understanding is that the menubar is simply a group of menus, which are pulldown controls.
I may be going about this the wrong way, and there might be an easier way to achieve what I want. Right now, I am wondering if someone can explain how I can create pulldown menus through code or create regular buttons and change them to pulldown controls. If there is a better way than my approach, I would be interested in learning that as well.
Create menus with transcript code
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Re: Create menus with transcript code
hi bobw...
To get you started I have attached a stack... have a look at the scripts of the two buttons...
Then have a look in the dictionary at 'templateButton' and 'templateGroup' ... that'll keep you busy
be well
Dixie
To get you started I have attached a stack... have a look at the scripts of the two buttons...
Then have a look in the dictionary at 'templateButton' and 'templateGroup' ... that'll keep you busy

be well
Dixie
- Attachments
-
- MakeButtonMenu.zip
- (2.07 KiB) Downloaded 202 times
Re: Create menus with transcript code
Dear bobw,
You can set the style of a button to menu, after which you can set its menuMode to pullDown.
If you want to run your stack outside the IDE, then you have only very limited possibilities to change the scripts of your buttons (up to 10 lines).
Kind regards,
Mark
You can set the style of a button to menu, after which you can set its menuMode to pullDown.
If you want to run your stack outside the IDE, then you have only very limited possibilities to change the scripts of your buttons (up to 10 lines).
Kind regards,
Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode
Re: Create menus with transcript code
Thanks Dixie. This looks like just what I was wanting. I'm eager to test this out. I thought templates were for creating new cards and I'll had to read up on templateButton now.
Re: Create menus with transcript code
Thanks Mark. I haven't tried running as a standalone yet. I'll watch for this limitation.