Create a toolbar

Deploying to Mac OS? Ask Mac OS specific questions here.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Klaus
Posts: 13829
Joined: Sat Apr 08, 2006 8:41 am
Location: Germany
Contact:

Re: Create a toolbar

Post by Klaus » Thu Mar 07, 2013 9:59 pm

Hi Mag,

ah, idea! :D

Open that stack and enter this in the messagebox:
put the editmenus of stack "your stack here"

If you get TRUE then set it to FALSE and vice vera:
set the editmenus of stack "your stack here" to TRUE ## or FALSE

This should cure the strange behaviour.


Best

Klaus

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Create a toolbar

Post by Mag » Sun Mar 10, 2013 11:11 pm

Hi Klaus, the value is false, I tried to change this value but it continues to think that the menubar are present in the window. Now I have a question: is the menu builder a reliable tool or it's better to create all by code?

PS
I tried to change the name of the menu group and it's disappeared. Fortunately I had a backup project.

shaosean
Posts: 906
Joined: Thu Nov 04, 2010 7:53 am

Re: Create a toolbar

Post by shaosean » Mon Mar 11, 2013 6:22 am

I think the menu builder is okay to use so long as you do not change anything afterwards, otherwise just roll your own..

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7238
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Create a toolbar

Post by jacque » Mon Mar 11, 2013 7:17 pm

Mag,

Your menu is still there but has probably scrolled out of view (I assume you're on a Mac, otherwise you'd see it.) This is how menus work on Mac. When you want the stack to scroll the menu area back into view so you can edit or see it, do as Klaus suggested and set the editmenus of the stack to true in the message box:

set the editmenus of this stack to true

Menu Builder is reliable for the most part. I generally use it to set up the menu structure and the skeleton scripts. After that I do any other editing in the property inspector. But you can continue to use Menu Builder to edit if you make sure you are working on the correct menu group. You really don't want to assign two groups as the menu in a stack, that will confuse things. Click the Edit button and choose the existing menu group to edit it. You can toggle the visibility of the group from there too, uncheck the button that sets the group as the stack menubar. Remember to set it back again later.

I have a tutorial about how menus work in LiveCode. Once you understand it the scrolling makes more sense:

http://www.hyperactivesw.com/mctutorial ... Menus.html
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Create a toolbar

Post by Mag » Mon Mar 11, 2013 11:18 pm

Thank you shaosean and jacque.

Jacque your tutorial is really, really well done, I learnt a lot about the menu handling in LiveCode, a big thank you.

jacque
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 7238
Joined: Sat Apr 08, 2006 8:31 pm
Location: Minneapolis MN
Contact:

Re: Create a toolbar

Post by jacque » Tue Mar 12, 2013 7:49 pm

Thanks, I'm glad it was useful. You can see how old the tutorials are, the screen shots are from Mac OS 9. :) When LiveCode releases the open source version I'm going to have to rewrite everything.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Create a toolbar

Post by Mag » Sun Mar 24, 2013 1:52 pm

I can't find a way to have Preferences menuitem to work. In the Menu Builder is not present any Preferences menu item, and in the standalone you can see one correctly located on the application menu, but it's disabled. I admit that I find a bit frustrating the handling of menu in LiveCode :oops:

PBH
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 129
Joined: Sun Feb 20, 2011 4:26 pm
Location: Vancouver Island, BC, Canada. ex.UK
Contact:

Re: Create a toolbar

Post by PBH » Sun Mar 24, 2013 3:30 pm

Mag,

The default Menubar created by the Menu Builder has a Preferences item at the end of the Edit menu, see attachment.

If you leave this in place (or add one to the end of an existing Edit Menu) and add your scripts to the MenuBar>Edit button the system will automatically move the Preferences menu item over to the Apple Menu on a Mac, the same happens with the About menu item under the Help menu.

HTH

Paul
Attachments
MenuBuilder.png
Menu Builder Screen Shot

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Create a toolbar

Post by Mag » Sun Mar 24, 2013 8:42 pm

Thank you Paul, implemented as you suggested, all works fine now. :mrgreen:

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Create a toolbar

Post by Mag » Tue Mar 26, 2013 10:19 am

Can't find a way to detect whether we are under retina or non-retina display under OS X. in iOS I use this

Code: Select all

if iphoneDeviceScale() is "2" then
But it seems to me that there is not a counterpart on desktop... :roll:

Mag
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 802
Joined: Fri Nov 16, 2012 10:51 pm

Re: Create a toolbar

Post by Mag » Tue Mar 26, 2013 10:53 am

BTW, the icon that appears in the box is clickable. Does anyone know a way to make it not clickable?

Post Reply

Return to “Mac OS”