Limiting the number of lines in menu buttons
Posted: Fri Mar 05, 2021 3:16 pm
I have found (LC 9.6.1, Mac OS 10.15.7) that the inspector option to limit the number of lines in a pulldown, popUp or option menu does nothing. If I have ten lines in the button, and set the "menuLines" property to 5,(either by hand or via the inspector) I still get all ten when I click on the button.
The dictionary states that this property only applies to option and combo styles, but in fact, of the four native styles, it applies only for combos.
The only way I can figure out how to limit the number of lines in the other three styles is to initially set a custom property, "the fullList", containing the full contents of the button, and then place this in the button script:
But this requires that the user to know to use the optionKey to limit the number of choices. It does, however, have the advantage that one can select any portion of the whole, which seems like a useful tool. And of course, one could always have set the contents of a menu Button under script control.
This is not the only place where the properties of certain menuButton styles are different from others.
But is the dictionary wrong about option menus, or, as usual, am I?
Craig
The dictionary states that this property only applies to option and combo styles, but in fact, of the four native styles, it applies only for combos.
The only way I can figure out how to limit the number of lines in the other three styles is to initially set a custom property, "the fullList", containing the full contents of the button, and then place this in the button script:
Code: Select all
on mouseDown
if the optionKey is down then put line 1 to 5 of the fullList of me into me
else put the fullList of me into me
end mouseDown
This is not the only place where the properties of certain menuButton styles are different from others.
But is the dictionary wrong about option menus, or, as usual, am I?
Craig