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

Home » Public Forums » archive » widget_droplist keyword problem
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
widget_droplist keyword problem [message #8948] Wed, 07 May 1997 00:00 Go to previous message
agraps is currently offline  agraps
Messages: 35
Registered: September 1994
Member
IDL Folks,

I can't seem to get the SET_DROPLIST_SELECT keyword to work for my
widget droplist. I want to be able to set values "ON", "OFF" for
different variables. I've never used the widget_droplist before, so
I'm wondering whether I'm missing something fundamental. No matter
where I put WIDGET_CONTROL with this keyword, the droplist selection
is not getting set by me. IDL is doing some "behind-the-scenes"
activity for setting the value on the droplist that I don't
understand.

Here's my test code. I borrowed this and modified it from the
IDL Wexmaster examples. I'm trying to set "OFF" upon startup of the
widget. (I'm running this on (680X0) Mac IDL v4.0.1)

Thanks in advance for any tips.

Amara


-------------------------------------------

PRO wonoff_event, event

; This procedure is the event handler for a simple droplist widget.
; The User Value of any widget touched into the variable 'eventval'

WIDGET_CONTROL, event.id, GET_UVALUE = eventval

; This CASE statement branches based upon the value of 'eventval':

CASE eventval OF
"ONOFF" : BEGIN
; The list has been touched.
; The index of the list item touched is held in
; 'event.index'...
;(But how is IDL setting the droplist value???)

; Put the value of 'event.index' into the variable
; 'selection'.
selection = event.index

; Print the index of the item selected in the
; IDL window:
PRINT, 'List item ' + STRING(selection) + ' selected.'
END
ENDCASE
END

;------------------------------

PRO wonoff, GROUP = GROUP
COMMON widgetbase, base

base = WIDGET_BASE(TITLE = 'ON/OFF Droplist Widget', /COLUMN)

listitems = ['ON', 'OFF']

list = WIDGET_DROPLIST(base, $ ; This list belongs to 'base'.
VALUE = listitems, $ ; Put 'listitems' in the list.
UVALUE = 'ONOFF', $
YSIZE = 20) ;

WIDGET_CONTROL, base, /REALIZE

WIDGET_CONTROL, base, SET_DROPLIST_SELECT=1 ;Set the OFF

XMANAGER, 'wonoff', base, GROUP_LEADER = GROUP

END

-----------------------------------

--

************************************************************ *************
Amara Graps email: agraps@netcom.com
Computational Physics vita: finger agraps@best.com
Multiplex Answers URL: http://www.amara.com/
************************************************************ *************
[Message index]
 
Read Message
Read Message
Previous Topic: bar_plot probs?
Next Topic: Return statement must have 1 value?

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

Current Time: Sat Oct 11 04:20:59 PDT 2025

Total time taken to generate the page: 0.72009 seconds