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

Home » Public Forums » archive » Re: Droplist Widgets: set initial value???
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: Droplist Widgets: set initial value??? [message #8074] Tue, 04 February 1997 00:00
Robert Moss is currently offline  Robert Moss
Messages: 74
Registered: February 1996
Member
Michel wrote:
>
> Hi all,
> I have a question concerning droplist widgets. Is it possible to set the
> active button of a droplist widget? The problem is, that I have a user
> menu containing a droplist widget (and some more); the user leave the
> dialog using the <ok> or the <cancel> button. But if the value of the
> droplist widget was changed and the <cancel> button is pressed, I would
> like to restore the old setting. Is this possible, or have I to use another
> widget?
>
> Michel


widget_control, droplist_widget_id, set_droplist_select = index

where index is the index of the droplist you want selected. See the
online help for WIDGET_CONTROL.


--
Robert M. Moss, Ph.D. - mossrm@texaco.com - FAX (713)954-6911
------------------------------------------------------------ -----
This does not necessarily reflect the opinions of Texaco Inc.
Re: Droplist Widgets: set initial value??? [message #8080 is a reply to message #8074] Tue, 04 February 1997 00:00 Go to previous message
Runar J|rgensen is currently offline  Runar J|rgensen
Messages: 6
Registered: December 1995
Junior Member
Michel wrote:
>
> Hi all,
> I have a question concerning droplist widgets. Is it possible to set the
> active button of a droplist widget?

No problem! :-)

Assume you have a droplist like this:

tlb=widget_base()
items=['Cancel','OK']
droplist=widget_droplist(tlb, value=items, uvalue=items,
event_pro='droplist_Event')

widget_control,tlb,/realize

; What index does 'OK' have
indx = where(items EQ 'OK')

;;; This is BAD, because where returns a lonarr and you need a single
value
; Set the current value in the droplist
widget_control,stations_list,set_droplist_select=indx(0)

What can be tricky is to obtain the right droplist ID. Use the
widget_info (with the parent, child, sibling or whatever keyword)
function for this.

Enjoy!
Runar

--
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -=-=-=-=-=-=-=-
Runar Jorgensen ||
University of Oslo || Phone: +47 2285 5664
Department of Physics || Telefax: +47 2285 5671
P.O.Box 1048 Blindern || email: runar.jorgensen@fys.uio.no
0313 Oslo; Norway ||
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -=-=-=-=-=-=-=-
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Multiple TVIM's to one scale.
Next Topic: Wanted: Image Registration Programs.

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

Current Time: Wed Oct 08 13:38:36 PDT 2025

Total time taken to generate the page: 0.00517 seconds