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

Home » Public Forums » archive » Re: how get value from combobox
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: how get value from combobox [message #60694] Tue, 10 June 2008 08:56
Jean H. is currently offline  Jean H.
Messages: 472
Registered: July 2006
Senior Member
skymaxwell@gmail.com wrote:
> how get value, which user selected, from combobox widget ???
> Thanks

from the help file:
Widget Events Returned by Combobox Widgets
Pressing the mouse button while the mouse pointer is over an element of
a combobox widget causes the widget to change the text field on the
combobox and to generate an event. The event structure returned by the
WIDGET_EVENT function is defined by the following statement:
{WIDGET_COMBOBOX, ID:0L, TOP:0L, HANDLER:0L, INDEX:0L, STR:""}
The first three fields are the standard fields found in every widget
event. INDEX returns the index of the selected item. This can be used to
index the array of names originally used to set the widget's value. If
the event was caused by text changes in an editable combobox, the INDEX
field will be set to -1. If you are using an editable combobox, it is
important to check for the value of -1 prior to using the value of the
INDEX field as an index into the array if items. The text of the current
selection is returned in the STR field, which may eliminate the need to
use the index field in many cases.

so, in your event handler, do something like:
IF (TAG_NAMES(event, /STRUCTURE_NAME) eq 'WIDGET_COMBOBOX') THEN
selectedText = event.str

Jean
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Workbench problem following update
Next Topic: How to add tie point information for ENVI in IDL?

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

Current Time: Wed Oct 08 18:39:53 PDT 2025

Total time taken to generate the page: 0.00425 seconds