the menuBar and the EditMenus
livfoss at mac.com
Fri Apr 11 19:22:31 CEST 2014
Thanks Kay for that input. The fact is, the stack which I'm setting up is supposed to show a drawing space (for graphs generated by mathematical formulae). It doesn't really matter if the Windows menu intrudes into the drawing space, since it doesn't occupy the whole horizontal width of the stack anyway. It's more important that a Mac user and a Windows user see the same result of graphing a particular equation. I am not the original author of this program (my job is essentially to productize an existing app), but I am faithfully following the original requirements - and I don't disagree with them.
Philosophically, though, I think the LC stack-height-changing convention is just a trick. It's mighty convenient for some people, but it's still a trick. IMHO the programmer ought to be able to manage the visible space any way they want. Not everyone will agree with me. I think there may be a number of kinds of app where the relation between a window and the objects within it should be constant across platforms (for example to show a particularly shaped image which reaches the edges of the stack window all around - maybe like a TV picture, where you might see the station's logo in the top left hand corner or whatever, but you wouldn't want to lose some of the picture).
Luckily I've just seen another mail from Mark Schonewille that tells me to do what I want (thanks, Mark!). I am about to try it out.
On 11 Apr 2014, at 12:15, Kay C Lan <lan.kc.macmail at gmail.com> wrote:
> I'm no expert with cross platform design, but, I thought the specific
> purpose of the editMenu property was so you can see and edit your menu if
> you need to. This should only be used whilst in the IDE; it should be false
> in your standalone.
> As for the 30 pixels, which I've seen reported as 27 elsewhere, lets say
> you have a stack which is 827 pixels tall. On a Windows standalone you must
> have the Windows menu at the top of the stack, so that takes up 27 pixels.
> So your actual stack height available to you to put your own buttons and
> images etc is only 800 pixels high.
> Now on the Mac side, you set the menubar property to the name of the group
> which is your Mac specific menu. What this does is displays your Mac menu
> at the top of the screen as is normal for Mac. Now if nothing else happened
> you'd have 27 pixels of blank space (or Windows menu, I'm not sure which)
> at the top of the stack window, which would be wrong. So to fix this LC
> automatically hides the top of the stack that would normally be reserved
> for the Windows menu.
> Yes LC has behaved like this for a very long time. How would you propose to
> have a stack with a workable height of 800 pixels, and then include or
> exclude the menubar in the stack depending on OS, without adjusting the
> height of the stack?
> I think the trick is, if working on Mac, is to create your Windows version
> first; i.e. set up your stack with a basic Windows menu, then place your
> first couple of controls below these. Then create your Mac menu and try
> setting the menubar property. It should then all make sense. Your users
> should never know because they'll never see the resize.
> On Fri, Apr 11, 2014 at 6:50 AM, Graham Samuel <livfoss at mac.com> wrote:
>> I'm still having a strange time with these two entities in a desktop Mac
>> app which is also designed to work on PCs. All I'm trying to do is to have
>> a Mac menu at the top of the screen, i.e. in the normal place for Macs, but
>> NOT to have the stack size altered compared to the PC version, where the
>> menu bar will be at the top of the window. This doesn't seem to work for
>> me, certainly not in the IDE. If I want my menu active in the Mac version,
>> it seems I must set the editMenus to false, which triggers the engine to
>> change the size of my stack (it takes 30 pixels off the height).
>> What I want to do is to set a group to be a menu bar (set the menuBar of
>> this stack to "myMenuGroup"), but also place it at the top of the window
>> where the PC version will use it, and then simply hide the PC version of
>> the menu if I'm not running on a PC. I do not want the stack size to
>> change. However, within the Mac IDE, unless I set the editmenus to false,
>> the IDE will not display my menu but will just continue showing its own
>> one. I don't think this used to happen, but I can show it happening now.
>> This augurs badly for the eventual standalone.
>> Is anyone else trying to develop a cross-platform (Windows and Mac) app
>> where the window (stack) size stays the same on both platforms? FWIW I'm
>> using LC 6.6.1 Commercial on Mavericks 10.9.2 - though the problem seems to
>> have existed for some time.
>> I guess I did something wrong, but I now have a very simple test stack
>> that shows the above behaviour, so unless there is a trick, I may have to
>> code my way out of the problem by forcing the stack size to change back
>> after editMenus is set.
>> Has anyone got a better solution?
>> use-livecode mailing list
>> use-livecode at lists.runrev.com
>> Please visit this url to subscribe, unsubscribe and manage your
>> subscription preferences:
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription preferences:
More information about the use-livecode