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 
Return to the default flat view Create a new topic Submit Reply
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 ||
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-= -=-=-=-=-=-=-=-
[Message index]
 
Read Message
Read Message
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: Sun Oct 12 16:31:47 PDT 2025

Total time taken to generate the page: 0.00279 seconds