Standalone + stack - menubar goes where?

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

Post Reply
rumplestiltskin
Posts: 223
Joined: Wed Jun 21, 2006 7:33 pm
Contact:

Standalone + stack - menubar goes where?

Post by rumplestiltskin » Sat Mar 24, 2018 12:48 am

Before I start heading down the wrong path, I thought I'd ask this question:

With a standalone (which acts as the launcher) and another stack (which contains all the meat of what needs to be done and stored), where is the proper stack to locate the menubar?

Everything I need to have the menu items do I am currently doing with buttons in the stack (Print, backup, export, modify records, etc.) but, as you might imagine, I'm ending up with an ugly mess of buttons which I hope to consolidate into a menu:
File > Print... and Quit
Edit > Copy list to clipboard
Maintenance > Export, Backup, Import

I know how to create the menubar and its items, and craft the necessary scripts but, when I tried putting the menubar as part of (what will be) the standalone, I'm getting an error about a non-existent chunk even though I select the menuitem (Print... in this case) with the proper stack in the foreground. So I'm thinking the menubar should actually be part of the changable stack and not part of what will be the standalone.

Do I have my head wrapped around this properly? I'm guessing that the menubar would not actually appear if the standalone app is in the foreground but only when the changeable stack is.

My app is intended for Mac right now but will eventually be released for Windows and Linux (so I don't want to do something that I have to totally re-write later).

Thanks very much for advice and suggestions!

Barry

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Standalone + stack - menubar goes where?

Post by quailcreek » Sat Mar 24, 2018 12:56 am

So you have a launch stack which opens the main stack and the launch stack is then closed. The menu would need to be in the main stack. If the menu were in the launch stack it would go away when the launch stack closes.
Tom
MacBook Pro OS Mojave 10.14

rumplestiltskin
Posts: 223
Joined: Wed Jun 21, 2006 7:33 pm
Contact:

Re: Standalone + stack - menubar goes where?

Post by rumplestiltskin » Sat Mar 24, 2018 1:12 am

I haven't actually hidden the launch stack but, if that's the proper method, I can do so. Should I assume this will also work if I deploy on Windows and Linux?

Thanks,
Barry

quailcreek
Posts: 746
Joined: Sun Feb 04, 2007 11:01 pm

Re: Standalone + stack - menubar goes where?

Post by quailcreek » Sat Mar 24, 2018 2:03 am

Generally you want to first check to make sure that the main stack that you're going to open is there. If it is then open it and close the launch stack. If it's not there then provide some type of error dialog to the user.
Tom
MacBook Pro OS Mojave 10.14

rumplestiltskin
Posts: 223
Joined: Wed Jun 21, 2006 7:33 pm
Contact:

Re: Standalone + stack - menubar goes where?

Post by rumplestiltskin » Sat Mar 24, 2018 2:32 am

Makes sense. Thanks very much for your help.

Barry

FourthWorld
VIP Livecode Opensource Backer
VIP Livecode Opensource Backer
Posts: 10052
Joined: Sat Apr 08, 2006 7:05 am
Contact:

Re: Standalone + stack - menubar goes where?

Post by FourthWorld » Sat Mar 24, 2018 3:20 am

Windows and Linux have the menu bar attached to the top of the stack. If you put it where you need it for those platforms. when that stack opens on Mac it'll automatically shows those menus in the global menu bar.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn

bwmilby
Posts: 462
Joined: Wed Jun 07, 2017 5:37 am
Contact:

Re: Standalone + stack - menubar goes where?

Post by bwmilby » Sat Mar 24, 2018 4:31 am

In a standalone, the stack that is bound to the app (the splash stack) must remain open until the app closes. Hiding it is the correct method. You may need to "start using" the main stack, but I have not actually done an app using this format yet. And as others have said, the menus should go in the main stack (especially for Windows/Linux where they are a part of the actual window).

Post Reply