widget_droplist keyword problem [message #8948] |
Wed, 07 May 1997 00:00  |
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/
************************************************************ *************
|
|
|
Re: Widget_Droplist [message #10111 is a reply to message #8948] |
Tue, 21 October 1997 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Neil Winrow writes:
> Can anyone answer my question?
>
> Is it possible to place a droplist within another droplist, so that when
> I select an item in the first droplist a further droplist appears from
> that item. Hope you understand my problem.
No, it is not possible to put a droplist within a droplist.
But if I understand your problem correctly, couldn't this
easily be done with a pull-down button menu?
Cheers,
David
-----------------------------------------------------------
David Fanning, Ph.D.
Fanning Software Consulting
E-Mail: davidf@dfanning.com
Phone: 970-221-0438
Coyote's Guide to IDL Programming: http://www.dfanning.com/
|
|
|