Re: Can I make entries in CW_PDMENU insensitive? [message #14396 is a reply to message #14385] |
Wed, 24 February 1999 00:00  |
davidf
Messages: 2866 Registered: September 1996
|
Senior Member |
|
|
Steffen Luesse (luesse@rad.uni-kiel.de) writes:
> I am using IDL 5.2 on solaris 2.6. I want to use the CW_PDMENU routine
> to create a pull-down menu in my widget programs. In principle,
> everything works well. However, I am wondering if it is possible to make
> some menu entries insensitive like I can do it with buttons or sliders
> when they should not be used. I did not find any information about my
> problem in the IDL documentation and would appreciate if anybody could
> give me a hint.
CW_PDMENU sounds like a good idea until you actually start
writing a widget program. Then you find you want to make
a button insensitive, or you want to assign a special event
handler to a button, or you want to put something in the
user value of a button, or whatever it is, and CW_PDMENU
doesn't let you do it.
At this point you can either hack the CW_PDMENU code (ugh!), or
you can do what I do and use the trivially easy solution of
setting the MENU keyword on button widgets to create your
own pull-down menus.
With the newfangled cut and paste capability found on most
modern computers, it's even easy to build a whole stack of
buttons quickly and easily. :-)
lev1 = Widget_Button(tlb, Value='Pull Down Menu', /Menu)
button = Widget_Button(lev1, Value='Level 1a')
button = Widget_Button(lev1, Value='Level 1b')
lev2 = Widget_Button(menuID, Value='Level 1c', /Menu)
button = Widget_Button(lev2, Value='Level 2a')
button = Widget_Button(lev2, Value='Level 2b')
Cheers,
David
--
David Fanning, Ph.D.
Fanning Software Consulting
Phone: 970-221-0438 E-Mail: davidf@dfanning.com
Coyote's Guide to IDL Programming: http://www.dfanning.com/
Toll-Free IDL Book Orders: 1-888-461-0155
|
|
|