menu buttons and showname

Peter Haworth pete at
Wed Jul 1 21:52:11 EDT 2015

I've struggled with using the showName property of a menu button pretty
much ever since I started using LC and beginning to wonder if I'm missing

The showName property needs to be true for the the user's selected choice
from, for example, an option menu to be displayed.  First problem - that's
the label not the name. But if the text of the menu happens to be empty,
its name is displayed instead of empty which normally isn't something you
want to happen.

The dictionary says "If the object
<> has a *label* property
<>, the label
<> is displayed
instead of the name." but I have not found that to be the case.  If a menu
button has non-empty text and label and you set the text to empty, its name
is displayed, not the label.

A good number of my menus are populated in a mouseDown handler with dynamic
content which may be empty.  My workaround has been to check for empty and
either set the button text to space, or set the showName property to false
and be sure to set it to true in the menu's menuPick handler.

This isn't a huge deal but am I missing something obvious?  Wouldn't be the
first time.

More information about the Use-livecode mailing list