Menubar on Windows

Deploying to Windows? Utilizing VB Script execution? This is the place to ask Windows-specific questions.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

bd525
Posts: 80
Joined: Sun Aug 31, 2014 12:43 am

Menubar on Windows

Post by bd525 » Mon Oct 02, 2023 2:24 pm

I'm aware of the difference in placement of the menubar Mac vs. Windows, and have come across that factor in reading through various LIvecode online user instruction materials, but it isn't clear to me yet how to deal with it. The "set the menuBar of this stack to <groupname>" command works fine. On Mac I don't need to do anything about the menuBar group's placement or visibility (I leave it invisible); it shows up and functions properly at the top of screen. On Windows if I set the group as visible it also functions correctly when clicked. My question is about how to get it to display properly on the Windows window. Must I write script to increase my app's window size and move all elements down 28 pixels to make room for the menubar strip at the top, as shown in the attachment, or is there coding (I have not yet been able to find) that makes that happen automatically? Thanks in advance for any guidance!

Bruce
Attachments
Tonal Assistant Screenshot.png

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

Re: Menubar on Windows

Post by dunbarx » Mon Oct 02, 2023 7:59 pm

I probably should not be posting here, because I rarely use Windows, and never with LiveCode.

But you are aware that there are two very different paradigms between Mac And Windows, in that on a Mac, the menubar is at the top of the screen, and an integral part of the screen, and on Windows the menubar is at the top of the window, and is an integral part of that window.

It is on a Mac only that the 28 pixel "lowering" is a thing.This can be seen in the menu Builder, where you can "set as stack Menu Bar" and simulate (ugh) a Windows machine.

Craig

bd525
Posts: 80
Joined: Sun Aug 31, 2014 12:43 am

Re: Menubar on Windows

Post by bd525 » Mon Oct 02, 2023 8:44 pm

Thanks for the reply, Craig. I work on Mac, so the graphic I posted is a mockup on Mac of what needs to be accomplished on Windows, namely, creating a strip at the top of the app window for the menubar menus, in my case just File and Help. So a Windows window needs to have greater height. I can code for adding that height--and moving all screen elements down the extra 28 pixels--in the openstack handler; I was just wondering if there is a builtin way for Livecode to accomplish that process. I'm a Director refugee, and that need was accounted for in the standalone creation process, but I understand that Livecode may not have the same capability.

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

Re: Menubar on Windows

Post by dunbarx » Mon Oct 02, 2023 9:01 pm

Hmmm.

If I understand you, have you tried just setting the "set as stack Menu Bar" checkbox? Does this not do the trick?

Craig

bd525
Posts: 80
Joined: Sun Aug 31, 2014 12:43 am

Re: Menubar on Windows

Post by bd525 » Tue Oct 03, 2023 1:57 pm

Yes, in Menu Builder I had my custom menubar designated as such, and "Set as stack Menu bar" checked. As I mentioned that was working fine on Mac--in both development and run-time modes--but not on Windows. And now, out of nowhere it seems, that has switched! On Mac my custom menubar is being ignored in favor of the defaultmenubar (which does nothing, as I have not programmed it to), and the custom menubar is working on Windows! (albeit with an extra-tall strip that I haven't yet figured out how to remedy) So I'll lay off with contributing to this thread in case it turns out I've done something silly, which has happened once or twice before on my forum posts. I must say, though, at this point it sure seems like Livecode bugs.

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

Re: Menubar on Windows

Post by dunbarx » Tue Oct 03, 2023 2:19 pm

Then send the stack to LiveCode>

https://quality.livecode.com

Craig

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

Re: Menubar on Windows

Post by FourthWorld » Tue Oct 03, 2023 4:10 pm

bd525 wrote:
Mon Oct 02, 2023 8:44 pm
the graphic I posted is a mockup on Mac of what needs to be accomplished on Windows
Can we see screenshots of the actual state of things, so we can better assess what's happening?
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

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

Re: Menubar on Windows

Post by jacque » Tue Oct 03, 2023 5:23 pm

It's not a bug, it's how menus work in LC. Ideally you would build your stack with the menubar placed at the top of the window; basically you build for the Windows platform from the start. If you didn't do that, move everything down to accommodate the menubar and place it there, increasing the height of the stack if necessary. Set the default menubar to your menu group, or if you only have a single stack you can just set it to the stack menubar. LC is smart enough to accommodate the menubar automatically based on the platform it is running on.

When on Mac, the window is shortened from the top so that the menubar is scrolled out of view and the menu appears as the system menu at the top of the monitor. When running on Windows, the stack is expanded and the placed menubar appears where it belongs on that OS.

There is a more complete explanation at my web site here: https://www.hyperactivesw.com. Choose Resources, then "How menus work".
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

stam
Posts: 2686
Joined: Sun Jun 04, 2006 9:39 pm
Location: London, UK

Re: Menubar on Windows

Post by stam » Tue Oct 03, 2023 7:17 pm

Thanks Jacque, very illuminating link, learn something every day ;)

bd525
Posts: 80
Joined: Sun Aug 31, 2014 12:43 am

Re: Menubar on Windows

Post by bd525 » Tue Oct 03, 2023 9:21 pm

I appreciate the further input from Richard and Jacqueline. The info in your note and website, Jacqueline, helped me understand the processes better.

I'm still befudddled by two issues, though:

The first attachment shows Menu Builder status with "Set as stack Menu bar" checked. This is how a Mac standalone gets structured, which is as it should be for Mac, except the menubar menus are wrong: the defaultMenubar rather than Menubar 1 as set in the Menu Builder and also established in openStack with "set the menuBar of this stack to "Menubar 1".

The second attachment, with Menu Builder status having "Set as stack Menu bar" unchecked, shows the menubar as it needs to be on Windows--and is accomplished in a standalone--and suggests two good news factors: 1) The menubar menus are correct as shown for Menubar 1 (just File and Help; no Edit), and 2) it appears I DON"T have to move screen elements down 28 pixels to account for the Windows menubar. Right? The not-so-good news: The menubar strip is about 90 pixels greater in depth than in needs to be. If there's some setting I goofed up on to cause that I have no idea what that would be.

I hope this makes sense. Seems to be some progress, I think...
Attachments
Screen Shot-Mac.png
Screen Shot-Windows.png

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

Re: Menubar on Windows

Post by jacque » Tue Oct 03, 2023 10:46 pm

bd525 wrote:
Tue Oct 03, 2023 9:21 pm
The first attachment shows Menu Builder status with "Set as stack Menu bar" checked. This is how a Mac standalone gets structured, which is as it should be for Mac, except the menubar menus are wrong: the defaultMenubar rather than Menubar 1 as set in the Menu Builder and also established in openStack with "set the menuBar of this stack to "Menubar 1".
Mac OS requires a File, Edit, and Help menu and those can't be removed. The best you can do is set the Edit menu to disabled so it is clear to the user that there is nothing to edit. Windows has no such requirement.

You see "LiveCode" in the Application menu because you're in the IDE and the OS puts the app name there. You can't control that either but when you build a standalone the OS will put your app's name there.
The second attachment, with Menu Builder status having "Set as stack Menu bar" unchecked, shows the menubar as it needs to be on Windows--and is accomplished in a standalone--and suggests two good news factors: 1) The menubar menus are correct as shown for Menubar 1 (just File and Help; no Edit), and 2) it appears I DON"T have to move screen elements down 28 pixels to account for the Windows menubar. Right? The not-so-good news: The menubar strip is about 90 pixels greater in depth than in needs to be. If there's some setting I goofed up on to cause that I have no idea what that would be.
Since you already have a menubar set up, you don't need to do anything else, LC will manage the visibility. The extra room at the top is the size of the menubar group. Edit the group to resize it and remove the extra space at the top. After that, you may have to move the contents of your stack up.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

bd525
Posts: 80
Joined: Sun Aug 31, 2014 12:43 am

Re: Menubar on Windows

Post by bd525 » Tue Oct 03, 2023 11:58 pm

Mac OS requires a File, Edit, and Help menu and those can't be removed.
In my original post I mentioned that my custom menubar on Mac was at first working properly. Here's a closeup of the upper left corner of an earlier standalone, showing File and Help menus in the Mac menubar but no Edit (which is what I want):
Mac Screen Shot.png
How and why that stopped working is a cold trail.
The extra room at the top is the size of the menubar group. Edit the group to resize it and remove the extra space at the top.
Here's a screenshot of the properties window for the custom menubar, showing a height of 32 pixels. Should that be determining the height of the menubar strip on Windows? (it isn't)
Menubar Group Properties screen.png
Or maybe you're referring to something else.

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

Re: Menubar on Windows

Post by jacque » Wed Oct 04, 2023 5:23 pm

The older menubar is a puzzle. When you got the menubar you wanted, were you building with an older version of LC? Maybe LC changed something in the interval to force an Edit menu. I've always allowed the Edit menu since I believe it's required.

I took another look at your group position and I see that the top is not placed at the top of the stack window. I think if you move it up and set the top to 0 it should work. Lock the group position to make sure it stays there.
Jacqueline Landman Gay | jacque at hyperactivesw dot com
HyperActive Software | http://www.hyperactivesw.com

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

Re: Menubar on Windows

Post by FourthWorld » Wed Oct 04, 2023 7:13 pm

bd525 wrote:
Tue Oct 03, 2023 11:58 pm
Mac OS requires a File, Edit, and Help menu and those can't be removed.
In my original post I mentioned that my custom menubar on Mac was at first working properly. Here's a closeup of the upper left corner of an earlier standalone, showing File and Help menus in the Mac menubar but no Edit (which is what I want):
I believe the OS automatic inclusion of an Edit menu went away when the OS moved "Preferences..." from the bottom of the Edit menu to the then-new Apple menu.

And IIRC, even when automatically included, menus are unlikely to contain all of the items you'll want for your application.

You'll want to add an Edit menu object into your menu group.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bd525
Posts: 80
Joined: Sun Aug 31, 2014 12:43 am

Re: Menubar on Windows

Post by bd525 » Wed Oct 04, 2023 10:47 pm

I FINALLY have the menubar working properly on both Mac and Windows. A huge thanks to all posters for the helpful guidance! No doubt the process would have taken MUCH longer working without assistance. This forum is a really great resource!

As long as I have this expert attention, though, a final (for now) issue: The menubar menus only show one item. Here's the properties pane for the first one:
Menu Properties Window.png
Two items, but only the top one shows when the menu is clicked.

Post Reply

Return to “Windows”