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

Home » Public Forums » archive » Re: Check marks on context sensitive menus
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Re: Check marks on context sensitive menus [message #39210] Mon, 26 April 2004 13:21
David Fanning is currently offline  David Fanning
Messages: 11724
Registered: August 2001
Senior Member
Charles Paxson writes:

> I would like to toggle a context sensitive menu item and indicate the on-off
> state with a check mark. Could some one advise? Thank you.

Here is an example program:

PRO Pull_Down_Menu_Events, event
Widget_Control, event.top, Get_UValue=currentSelection
Widget_Control, currentSelection, Set_Button=0
Widget_Control, event.id, Set_Button=1
currentSelection = event.id
Widget_Control, event.top, Set_UValue=currentSelection
END ;-----------------------------------------------------



PRO Pull_Down_Menu

tlb = Widget_Base( title = 'Menu Test')

menu = Widget_Button(tlb, /Menu, Value='Pull-Down Menu', $
Event_Pro='Pull_Down_Menu_Events', Scr_XSize=150)
catID = Widget_Button(menu, Value=' Cat', /Checked_Menu)
dogID = Widget_Button(menu, Value='Dog', /Checked_Menu)
coyoteID = Widget_Button(menu, Value='Coyote', /Checked_Menu)
frogID = Widget_Button(menu, Value='Frog', /Checked_Menu)
current = catID
Widget_Control, catID, Set_Button=1
Widget_Control, tlb, /Realize
Widget_Control, tlb, Set_UValue=current
xmanager, 'Pull_Down_Menu', tlb, /No_Block

END

This will require IDL 6.0 and higher.

Cheers,

David

--
David Fanning, Ph.D.
Fanning Software Consulting
Coyote's Guide to IDL Programming: http://www.dfanning.com/
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Check marks on context sensitive menus
Next Topic: Re: Is there any conventions style programming IDL?

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

Current Time: Sat Oct 11 12:54:29 PDT 2025

Total time taken to generate the page: 0.64059 seconds