Deploying to Mac OS? Ask Mac OS specific questions here.
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller
-
Mag
- VIP Livecode Opensource Backer

- Posts: 802
- Joined: Fri Nov 16, 2012 10:51 pm
Post
by Mag » Mon Jul 07, 2014 5:27 pm
Ok, I'm about to finish a project for OS X

The last time I created a Mac app, I keep the menus as the last thing because I found the way you create menus in LC a bit intricated, maybe I did not have the proper knowledge, I used Menu manager. Is there a way do you suggest to handle them just via code? And work for all the windows too.
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Mon Jul 07, 2014 6:07 pm
http://www.hyperactivesw.com/mctutorial ... Menus.html
This tutorial is about converting HyperCard stacks to LiveCode, but since you do not yet have any menus in place you will need to follow all the same steps. The explanation of how menus work in LiveCode should help you understand what is happening. Really, you should always create your menu group as the first thing you do when beginning a stack, because the placement of all the other controls on the card must accomodate the menu group. If you did not yet create a menu, then everything in the stack must be moved down so there is room for the menu at the top of the card.
Apologies for the ancient screen shots in the tutorial, I just haven't had time to update them. But the content still applies, even though we no longer run LC in Mac OS 9.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
Mag
- VIP Livecode Opensource Backer

- Posts: 802
- Joined: Fri Nov 16, 2012 10:51 pm
Post
by Mag » Mon Jul 07, 2014 6:19 pm
Hi jacque,
thank you so much, you replay is very helpful, as usual. For my previous app I followed you guide
Question: can I create the menu buttons in a new substack and the use it as defaultMenubar for all the stacks? I ask this because I read this in the User Guide:
The default menu bar
If other stacks in your application don't have their own menu bars, set the defaultMenubar global property to the name of your menu group, as well as setting the stack's menubar property. The defaultMenubar is used for any stack that doesn't have a menu bar of its own.
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Mon Jul 07, 2014 7:00 pm
Yes, you could use a default menu, but it doesn't work on Windows, that is a Mac-only feature. Since you want menus in Windows too, you'll need to create them directly in the stack. Or you could do what LC does and put your menus into a separate palette stack, which you display only on the Windows platform. But if you do that, you'll need to manage the messages a little differently because "this stack" isn't always the one with the menus. Also, if you set the default menubar in the IDE, it is possible to lose the LC menus. Usually I find it much easier to just put the menu group into the stack itself.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com
-
Mag
- VIP Livecode Opensource Backer

- Posts: 802
- Joined: Fri Nov 16, 2012 10:51 pm
Post
by Mag » Mon Jul 07, 2014 7:35 pm
Really useful info jacque.
So my app seems the ideal candidate, it's for Mac and it handles different windows (one for each document).
I will try and then come here to ask for more help I guess

Thanks
-
Mag
- VIP Livecode Opensource Backer

- Posts: 802
- Joined: Fri Nov 16, 2012 10:51 pm
Post
by Mag » Mon Jul 07, 2014 8:23 pm
OK, just tryed this:
set the defaultMenubar to "MenubarGroup" -- works well
unfortunately, as expected this doesn't work
set the defaultMenubar to empty -- doesn't work
-
Mag
- VIP Livecode Opensource Backer

- Posts: 802
- Joined: Fri Nov 16, 2012 10:51 pm
Post
by Mag » Mon Jul 07, 2014 9:03 pm
Another thing that I noticed is that if I use a button and then use the command
set the menubar of this stack to "MenubarGroup"
Also if the button has 5 menuitems, in the menubar are displayed 3. Is this normal?
-
jacque
- VIP Livecode Opensource Backer

- Posts: 7393
- Joined: Sat Apr 08, 2006 8:31 pm
-
Contact:
Post
by jacque » Wed Jul 09, 2014 7:05 pm
Mag wrote:
Also if the button has 5 menuitems, in the menubar are displayed 3. Is this normal?
It's normal if the menu is File, Edit or Help. On a Mac, there is a specific order that is required in the menu items of these two menus so that they will automatically be moved to the correct positions on OS X. I talk about that in the menu tutorial I linked to, or see page 258, "Special menu items", in the User Guide. Bascially the last two menu items in both those menus must never change from the defaults the Menu Builder sets up.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com