Re: sensitivity of individual droplist values? [message #64330] |
Fri, 19 December 2008 18:37  |
Kathleen
Messages: 3 Registered: December 2008
|
Junior Member |
|
|
Thank you M.Katz. That is what I was afraid of. That method certainly
requires a bit more work than I was hoping to contribute to a single
widget. Especially since I have over 50 widgets in my application and
several droplists that would require this modification. Might have
been easier to handle if the last item was always the one to drop off
the list. Unfortunately, that is not the case. If anyone has any other
ideas, I would love to hear them.
|
|
|
Re: sensitivity of individual droplist values? [message #64332 is a reply to message #64330] |
Fri, 19 December 2008 14:54   |
M. Katz
Messages: 69 Registered: May 2005
|
Member |
|
|
I don't know of a way to gray out one or more selections
in the WIDGET_DROPLIST menu, but you do have control over
the list of items that are displayed.
It requires a bit more flexible programming, but you can
keep a "full list" of menu items, and a second, pared-down
list, that is appropriate at the moment. The pared-down
list can be put in place with something like
widget_control, DroplistID, SET_VALUE=list
Once you make this command, the user should see a new list.
The minor challenge for you with this approach will be handling
the events. The event structure tells you the event.index
of the item that has been selected. If you change
from the full list to the short list, it's up to you to
determine which option the user selected in the short list.
M. Katz
|
|
|
Re: sensitivity of individual droplist values? [message #64373 is a reply to message #64330] |
Tue, 23 December 2008 02:25  |
Spon
Messages: 178 Registered: September 2007
|
Senior Member |
|
|
On Dec 20, 2:37 am, Kathleen <101ferr...@gmail.com> wrote:
> Thank you M.Katz. That is what I was afraid of. That method certainly
> requires a bit more work than I was hoping to contribute to a single
> widget. Especially since I have over 50 widgets in my application and
> several droplists that would require this modification. Might have
> been easier to handle if the last item was always the one to drop off
> the list. Unfortunately, that is not the case. If anyone has any other
> ideas, I would love to hear them.
Hi Kathleen,
If you can get away with using a menu bar rather than a droplist, it
makes desensitizing subwidgets a whole lot easier.
Something like this:
TLB = Widget_Base(/Col, MBAR = MBAR)
File = Widget_Button(MBAR, Value = 'File')
Frog = Widget_Button(File, Value = 'Frog')
Womble = Widget_Button(File, Value = 'Womble', $
Sensitive = 0)
Cabbage = Widget_Button(File, Value = 'Cabbage')
If you've got over 50 widgets, it might require a whole lot of
rewriting in your case, though. Plus, you can't control where in the
widget your menu bars appear.
There's also the option of using CW_PDMENU which I haven't really
delved into myself, but my experience with IDL functions that begin
with 'CW_' leads me to believe that a *lot* of headaches might lie
down that path...
Best of luck!
Chris
|
|
|