Re: widget_droplist keyword problem [message #8942] |
Wed, 07 May 1997 00:00 |
Amara Graps
Messages: 24 Registered: June 1996
|
Junior Member |
|
|
Mike Schienle wrote:
>
> Amara Graps wrote:
>
>> I can't seem to get the SET_DROPLIST_SELECT keyword to work for my
>> widget droplist.
> ...
>> WIDGET_CONTROL, base, SET_DROPLIST_SELECT=1 ;Set the OFF
> ^^^^
> I suspect your example actually tries to change the the droplist (list),
> not the base (base), but the code you supplied seems to be doing
> something else. What you supplied should work if you give it the ID of
> the list.
Yep.. that was it. I needed:
WIDGET_CONTROL, list, SET_DROPLIST_SELECT=1 ;Set the OFF
^^^^
Simple, no?
> If it needs more than that let me know and I'll provide a
> running example that works on my system. In the meantime, here's some
> code that deals with two different droplists.
Thanks for your example. It's a lot fancier than my current use of
droplists.
Amara
--
************************************************************ *****
Amara Graps
amara@quake.stanford.edu
Solar Oscillation Investigations Stanford University
http://quake.stanford.edu/~amara/
************************************************************ *****
"Never fight an inanimate object." - P. J. O'Rourke
|
|
|
Re: widget_droplist keyword problem [message #8944 is a reply to message #8942] |
Wed, 07 May 1997 00:00  |
Mike Schienle
Messages: 37 Registered: May 1997
|
Member |
|
|
Amara Graps wrote:
> I can't seem to get the SET_DROPLIST_SELECT keyword to work for my
> widget droplist.
...
> WIDGET_CONTROL, base, SET_DROPLIST_SELECT=1 ;Set the OFF
^^^^
I suspect your example actually tries to change the the droplist (list),
not the base (base), but the code you supplied seems to be doing
something else. What you supplied should work if you give it the ID of
the list. If it needs more than that let me know and I'll provide a
running example that works on my system. In the meantime, here's some
code that deals with two different droplists.
Here is some code from an event handler that runs on a few SGI's and a
couple of PowerMac's around here. The mChild and mLocal portions just
refer to elements within a structure. In this case, I get the droplist
selections for two different droplists; check if they are not equal;
then set the "plot" type to match the "correlation" type. The
[un]mapping is just to manage some items within a base which has no row
or column settings.
; get the plot panel plot type
lPDropVal = Widget_Info(mChild.wDropPlot, /DropList_Select)
; get the correlation panel plot type
lCDropVal = Widget_Info(mLocal.wDropPlot, /DropList_Select)
IF (lPDropVal NE lCDropVal) THEN BEGIN
; unmap the plot panel plot type
Widget_Control, mChild.awBasePlotType(lPDropVal), Map=0
; change plot panel plot type to
; correlation panel plot type
Widget_Control, mChild.wDropPlot, Set_DropList_Select=lCDropVal
; map the correlation panel plot type
Widget_Control, mChild.awBasePlotType(lCDropVal), Map=1
ENDIF
In the widget definition module below I do similar steps to make the
selected item of one droplist (wDropPlot) match the specified item of a
different droplist (mParent.wDropPlot). In the event handler section
above these are referred to as mChild and mLocal, respectively.
lDropVal = Widget_Info(mParent.wDropPlot, /DropList_Select)
wDropPlot = Widget_DropList(wBaseCommon, Title='Plot:', $
Value=mMisc.plotType)
Widget_Control, wDropPlot, Set_DropList_Select=lDropVal
mLocal = {wDropList: wDropList, ... }
Let me know if you need a better description or running code.
--
Mike Schienle Hughes STX - EROS Data Center, Sioux Falls, SD
Work: schienle@edcsgw13.cr.usgs.gov Home: mgs@sd.cybernex.net
|
|
|