Stack Menu Mystery - Disappointing Documentation (Long, sorry)

Graham Samuel livfoss at mac.com
Sat Nov 22 09:45:12 EST 2014


I’ve been using LC for a long time but I’ve never used a stack menu. I now find that I can’t understand the documentation of the stack menu in the LC User Guide. I have tried to follow it to produce a test app, and I’ve got this far. I’m using LC7.0.1 (rc2) on a Mac with Yosemite.

I’ve made a mainstack “StackMenuTests” with one card.

I’ve made a substack “TheMenuStack” with one card.

I’ve put three buttons into the substack, named “File”, “Edit” and “Help.I’ve given them the properties mentioned in the documentation. In each one I’ve put a mouseUp handler that just uses ‘answer’ to inform the user that it’s been invoked. Although it the docs didn’t tell me to do so, I set the style of each button to ‘menu’ (you can’t do this directly in the IDE, you have to do it via the message box) and each menuMode to ‘pulldown’. I've put some items in the text box in each one’s Property Inspector. The docs don’t say how I can get my ‘mouseUp’ handler to identify an individual menu item, so I’ve left that bit out for now.

I’ve made the size of the stack just enough to show the buttons.

I’ve put one button in the mainstack, with a script that says (again from the documentation)

 on mouseDown
   popup stack “TheMenuStack”
 end mouseDown

I don’t know how I can use this to make the stack menu ‘look like a standard menu’ as the UG says, especially as regards positioning, but let’s leave that one aside for now.

So far, so good: when I click the button on the mainstack, the stack menu appears, but clicking on the individual buttons doesn’t do anything, and the menu disappears again. So in fact I have not made it work at all. I tried putting a ‘mouseDown’ button in one of the handlers, and it fires sometimes but not reliably, and I don’t know what the next move would be anyway.

The LC documentation doesn’t help with this, and as far as I am concerned there is a serious bug in the User Guide (without documentation, a product such as LC doesn’t fully exist, IMO). When I get the thing working, I intend to report it as such.

Meanwhile can anyone explain how to get the thing to work at all? My aim is to have some small pictures in the menu items (which is what the docs suggest the feature is for) but that’s not possible if I can’t get the thing to work at a basic level.

Oh, and if someone is kind enough to explain, can they say how cross-platform this is going to be - for example, do I have to change the font of any text to conform with the system font of the chosen platform? AFAIK, LC does this for me for ‘normal’ menus, when switching from Windows to Mac (don’t know about *nix).

TIA for any clarification

Graham






More information about the use-livecode mailing list