comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Re: combobox widget text
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: combobox widget text [message #63574] Fri, 14 November 2008 14:50 Go to previous message
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
greg.addr@googlemail.com writes:

> Does anyone know how to set the value of an editable combobox such
> that it's *not* one of the current list items? I have the drop-down
> filled with standard values, but want to be able to save and recover a
> user entered value

Here is a little example that allows the users to type new
animal names into the combobox. If the name is not currently
on the combobox list, it is added.

;*********************************************************** ****
PRO test_event, ev
IF ev.index EQ -1 THEN BEGIN
Widget_Control, ev.id, Get_Value=currentVal
I = Where(StrUpCase(currentVal) EQ StrUpCase(ev.str), count)
IF count EQ 0 THEN $
Widget_Control, ev.id, Set_Value=[currentVal, ev.str]
ENDIF
end

PRO test

b = Widget_base(/column, xoffset=50, yoffset=50)
t = widget_combobox(b, value=['dog', 'cow', 'coyote'], $
/EDIT, SCR_XSIZE=100)
widget_control, b, /realize
xmanager, 'test', b, /no_block
END
;*********************************************************** ****


Cheers,

David
--
David Fanning, Ph.D.
Fanning Software Consulting, Inc.
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Sepore ma de ni thui. ("Perhaps thou speakest truth.")
[Message index]
 
Read Message
Read Message
Previous Topic: ncdf string array dimension
Next Topic: how to draw contour with continue color?

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 17:18:13 PDT 2025

Total time taken to generate the page: 0.00432 seconds