good practise on handling menues on Mac?

Paul Hibbert lc at pbh.on-rev.com
Tue Jan 29 03:11:36 EST 2013


To follow up…

I fired up Parallels for some experimenting on Windows and found out that the "Set as stack Menu bar" check box in the Menu Builder does have an effect on the Menubar, at least on Win 7. It adds a background decoration to the Menubar, but that only shows for the width of the Menubar buttons plus a bit, it doesn't extend to the right hand side of the window, so I did a little more experimenting.

The default Menubar on other apps does cover the full width of the window, I added the following to the stack script to achieve the same effect in LC, but this feels a bit like like a bodge, so does anyone know if there is a better or easier way to do this?

##

on openStack
   if the platform is "Win32" then ## Don't need this for Mac - Not sure about Linux
      lock screen
      # Store the loc of the buttons to use in resizeStack, otherwise they wander
      repeat with x = 1 to the number of controls in grp "MenubarX"
         set the uLoc of control x of grp "MenubarX" to the loc of of control x of grp "MenubarX"
      end repeat
      # Store the left of the Menubar to use in resizeStack
      set the uMenuLeft of grp "MenubarX" to the left of grp "MenubarX" 
      # The standard Menubar over hangs by 3px to the left so do the same on the right
      set the width of grp "MenubarX" to the width of this stack + 6 
   end if
   unlock screen
   revUpdateGeometry ## Ensures everything views correctly
end openStack

on resizeStack newWidth
   if the platform is "Win32" then
      lock screen
      set the width of grp "MenubarX" to newWidth + 6
      set the left of grp "MenubarX" to the uMenuLeft of grp "MenubarX" # To anchor the LH side
      # Required to stop the buttons from wandering
      repeat with x = 1 to the number of controls in grp "MenubarX"
         set the loc of control x of grp "MenubarX" to the uLoc of of control x of grp "MenubarX"
      end repeat
   end if
   unlock screen
   revUpdateGeometry ## Ensures everything views correctly
end resizeStack

##

Paul

On 2013-01-28, at 8:17 AM, Paul Hibbert wrote:

> Tiemo,
> 
> It's not usual to show your own menus on a Mac, if you check the option to "Set as stack Menu bar" that is next to the Menu bar name in the Menu Builder (LC 5.5.3) it will integrate your menu with the standard Mac Menu bar so you won't have duplicate 'Quit" item.
> 
> I don't think this check box has any effect on Windows, but I'm not 100% sures, I just noticed that in the latest user guide (p113) it shows a version of the Menu Builder that has the label "Set as Menu Bar on Mac OS".
> 
> Paul
> 
> On 2013-01-28, at 6:20 AM, Tiemo Hollmann TB wrote:
> 
>> Hello,
>> 
>> Still not being good on Mac I wonder what is a good practice?
>> 
>> When building an app for windows, you create your own app menus. For example
>> you have the standard "file - quit" menu item
>> 
>> When taking over this app to Mac you still have (more or less) the same
>> menus. But additionally you get the standard apple menu, where you now have
>> additionally a quit (Cmd + Q) item to quit your app.
>> 
>> How do you handle this duplicity of menus?
>> 
>> Do you actually show your own menus on Mac, or is there a way to suppress it
>> on Mac and put all items into the "apple menu bar" ? And if, how?
>> 
>> Thanks for any pointers
>> 
>> Tiemo
>> 
>> 
>> 
>> 
>> 
>> _______________________________________________
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
>> http://lists.runrev.com/mailman/listinfo/use-livecode
> 
> 
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode





More information about the use-livecode mailing list