Un-Menu

Got a LiveCode personal license? Are you a beginner, hobbyist or educator that's new to LiveCode? This forum is the place to go for help getting started. Welcome!

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9454
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Un-Menu

Post by richmond62 » Fri Oct 20, 2023 12:47 pm

I have a stack with a menu that I want to appear on Windows and Linux, and I want to appear on Macintosh the same way as on Windows and Linux, and NOT along the top menu bar in the MacOS GUI . . .

Does anyone know how I can prevent this happening?

I do NOT want this:
-
Screen Shot 2023-10-20 at 2.43.03 pm.png
-
Attachments
Menu Learn.livecode.zip
Stack
(1.71 KiB) Downloaded 68 times

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

Re: Un-Menu

Post by Klaus » Fri Oct 20, 2023 1:34 pm

Hi Richmond,

this is a bit tricky! :-)
Do like this:
1. Create a substack and make if look like a Windows menubar with #2
2. Copy your menu group to that stack
3. MOST important: DELETE that menu group from your mainstack or it will cause the bloody resizing of the mainstack! Never got that!?
4. Then you need to script the desired behavior in preopenstack of your mainstack:

Code: Select all

on preopenstack
   ## Avoid the menu in the IDE
   if the environment = "standalone application" then
      switch the platform
         case "win32"
            go stack "your substack here" as palette
            break
         case "mac"
            set the defaultmenubar to the long ID of group "your menugroup name here" of stack "your substack here"
            break
      end switch
   end if
   # other preopenstack stuff here...   
end preopenstack
Hope that helps.

Best

Klaus

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9454
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Un-Menu

Post by richmond62 » Fri Oct 20, 2023 1:43 pm

Hope that helps.
Not really, I'm afraid, as I want a single stack.

I tried this:
-
Screen Shot 2023-10-20 at 3.39.16 pm.png
-
The difference is that it does NOT have this in the stackScript:

Code: Select all

on preOpenStack
   set the menubar of this stack to "myMenu"
end preOpenStack
But I assume that will cause merry hell with Linux and Windows standalones.

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

Re: Un-Menu

Post by Klaus » Fri Oct 20, 2023 2:09 pm

richmond62 wrote:
Fri Oct 20, 2023 1:43 pm
Hope that helps.
Not really, I'm afraid, as I want a single stack.
Sorry, no idea if and how this could be done.

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9752
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Un-Menu

Post by dunbarx » Fri Oct 20, 2023 2:32 pm

Richmond,

I am not clear. What happens if you do NOT set "set as Stack Menubar" in the menu builder?

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9454
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Un-Menu

Post by richmond62 » Fri Oct 20, 2023 3:25 pm

No menu under MacOS, BUT wonder if that wouldn't screw up menus on Linux and Windows.

Oh, and I did NOT use the menu builder.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9857
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Un-Menu

Post by FourthWorld » Fri Oct 20, 2023 3:36 pm

The Menu Builder is VERY handy. Getting all the properties set right is very tedious without it.

Like Craig said, just do what the User Guide suggests, but don't check the option for the Mac global menu bar.

Warning: this will freak out users. The global menu bar is such a long established convention with Mac that those users will often express negative opinions about an app that puts its menu bar at the top of the window.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

dunbarx
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9752
Joined: Wed May 06, 2009 2:28 pm
Location: New York, NY

Re: Un-Menu

Post by dunbarx » Fri Oct 20, 2023 4:12 pm

Richmond.

How have you survived without using the menu builder? As Richard said, it is one of those gadgets that really works, and it is no fun at all to build custom menus without.

Craig

richmond62
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 9454
Joined: Fri Feb 19, 2010 10:17 am
Location: Bulgaria

Re: Un-Menu

Post by richmond62 » Fri Oct 20, 2023 5:10 pm

How have you survived without using the menu builder?
By never building a menu until today. :)

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

Re: Un-Menu

Post by Klaus » Fri Oct 20, 2023 5:29 pm

Hi RIchmond,
richmond62 wrote:
Fri Oct 20, 2023 12:47 pm
I have a stack with a menu that I want to appear on Windows and Linux, and I want to appear on Macintosh the same way as on Windows and Linux, and NOT along the top menu bar in the MacOS GUI...
sorry, I misunderstood this completely!
In that case you will NEED a substack that will act as a menubar palette like on Windows and as described earlier!

And be aware that you cannot have NO menubar on a Mac. The OS will then create a rudimentary one with the
Apple Menu and a menu with the name of your app.

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9857
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Un-Menu

Post by FourthWorld » Fri Oct 20, 2023 6:40 pm

I'm reading it the opposite, that he wants a menu bar across the top of the window on all three platforms.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Un-Menu

Post by Klaus » Fri Oct 20, 2023 6:47 pm

Yes, then he will need the substack acting as the MENUBAR (palette) as I dscribed earlier.

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

Re: Un-Menu

Post by jacque » Fri Oct 20, 2023 9:27 pm

Set the editmenus of the stack to false. (This is the "set as stack menubar" option in the Menu Builder, which you really should be using.)
Position the group at the top of your stack. (Menu builder does this for you.)
That's all.

Your Mac users will hate the app, and if you have more than one stack you will need to put the menu on all of them. Make the group a background group so it is shared on all cards. On Mac, the menu group will look like Windows. Keyboard shortcuts may or may not work on Mac.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 9857
Joined: Sat Apr 08, 2006 7:05 am
Location: Los Angeles
Contact:

Re: Un-Menu

Post by FourthWorld » Fri Oct 20, 2023 10:36 pm

Klaus wrote:
Fri Oct 20, 2023 6:47 pm
Yes, then he will need the substack acting as the MENUBAR (palette) as I dscribed earlier.
I don't understand. If he wants the menu bar along the top of the window, why couldn't he just put the menu bar along the top of the window?

That's the standard way Linux and Windows work, and he seems to want that on macOS as well (though I wouldn't advise it and it's so easy to just do what Mac users expect by just setting the stack's menubar property, just a checkbox away when using the Menu Builder).
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Un-Menu

Post by Klaus » Sat Oct 21, 2023 9:00 am

FourthWorld wrote:
Fri Oct 20, 2023 10:36 pm
Klaus wrote:
Fri Oct 20, 2023 6:47 pm
Yes, then he will need the substack acting as the MENUBAR (palette) as I dscribed earlier.
I don't understand. If he wants the menu bar along the top of the window, why couldn't he just put the menu bar along the top of the window?
Hey, it's Richmond! :lol: :lol: :lol:
FourthWorld wrote:
Fri Oct 20, 2023 10:36 pm
That's the standard way Linux and Windows work, and he seems to want that on macOS as well (though I wouldn't advise it and it's so easy to just do what Mac users expect by just setting the stack's menubar property, just a checkbox away when using the Menu Builder).
Well, see above...

Post Reply

Return to “Getting Started with LiveCode - Complete Beginners”