How to create a combobox button by a script?

Sarah Reichelt sarah.reichelt at gmail.com
Sat Jan 24 17:54:43 EST 2009


> I want to create a combobox-button.
>
> I failed with this script:
>
> on mouseUp
>   create btn "Test"
>   set the menuMode of btn "Test" to comboBox
>   set the menuLines of btn "Test" to 5
>   put "A" & cr & "B" & cr & "C" & cr & "D" & cr & "E"  into btn "Test"
> end mouseUp


You just need one extra line:
       set the style of btn "Test" to "menu"

You might also want to set the size of your combobox as the default
height is too much and so the combo menu appears offset.

Cheers,
Sarah



More information about the use-livecode mailing list