combobox

Terry Judd tsj at unimelb.edu.au
Sun Mar 20 22:46:40 EDT 2011




On 21/03/11 12:38 PM, "Kee Nethery" <kee at kagi.com> wrote:

> Thanks Terry,
> 
> Actually I'm at the point of one step forward two steps back.
> 
> I appear to be unable to put the return delimited list into the combobox more
> than a couple of times. I've tried all of these variations of the script to
> alter the combobox text:
> 
> put theList into me
> put theList into button "myComboBox"
> put theList into field "myComboBox" of button "myComboBox"
> put theList into field "myComboBox"

I think you should be setting the text of the button.
> 
> I can get one or two inserts (I type different things into the combobox)
> before the whole stack crashes and the apple "Problem Report for LiveCode"
> appears.
> 
> ----
> 
> When I can get the combobox data to get updated, the following scripts don't
> leave the text selected (the data in the combobox is for these examples always
> more than 5 characters in length):
> 
> select char 2 to 5 of me
> select char 2 to 5 of button "myComboBox"
> select char 2 to 5 of field "myComboBox"
> select char 2 to 5 of field "myComboBox" of button "myComboBox"
> select char 2 to 5 of the label of me
> select char 2 to 5 of fld 0 of me   <-- not sure what "fld 0" is in a button
> but tried it anyway

So in a keyUp handler you get line 1 of the text of the control (or the
label of the control) and based on it you create your list of options. You
then set the text of the control to this list and then select the characters
as suggested. As in...

Select char length(<original label>)+1 to -1 of fld 0 of me

Based on my limited testing this works as advertised (it didn't fail on
repeated testing) on Mac OSX but I can't vouch for it on Windows.

HTH,

Terry...

> 
> Thank you for your suggestions.
> 
> The only example I'd seen of changing a combobox contents is in the font
> portion of the inspector but I'm not sure how to access that code to see what
> they are doing, how exactly they are referring to that content.
> 
> The documentation has almost nothing about combo boxes. There is something
> different about them.
> 
> Kee
> _______________________________________________
> use-livecode mailing list
> use-livecode at lists.runrev.com
> Please visit this url to subscribe, unsubscribe and manage your subscription
> preferences:
> http://lists.runrev.com/mailman/listinfo/use-livecode
> 

--
Dr Terry Judd | Senior Lecturer in Medical Education
Medical Education Unit
Melbourne Medical School
The University of Melbourne







More information about the use-livecode mailing list