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

Home » Public Forums » archive » Re: XResources and menu mnemonics
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: XResources and menu mnemonics [message #14579] Fri, 12 March 1999 00:00
davidf is currently offline  davidf
Messages: 2866
Registered: September 1996
Senior Member
Mathew Yeates (mathew@nospam-fugue.jpl.nasa.gov) writes:

> I have the following simple app
> which creates a menu.
>
> pro test2
> base = WIDGET_BASE(TITLE = 'Example', MBAR=bar,rname_mbar='test2')
> file_menu = WIDGET_BUTTON(bar, VALUE='File',
> MENU=2,Resource_name='filemenubut')
> file_bttn1=WIDGET_BUTTON(file_menu, VALUE='Item 1',$
> �������������������� ��� UVALUE='FILE1')
> file_bttn2=WIDGET_BUTTON(file_menu, VALUE='Item 2',$
> �������������������� ��� UVALUE='FILE2')
> WIDGET_CONTROL, /REALIZE, base
> XMANAGER, 'test2', base
> end
>
>
> and a resource file that says,
>
> Idl*test2*filemenubut*mnemonic: F
> Idl*test2*filemenubut*accelerator: Meta<key>F4
> Idl*test2*filemenubut*acceleratorText:Meta-F4
> Idl*test2*filemenubut*background: red
>
>
> The "File" button gets an underscore like its supposed to. But
> typing 'F' on the keyboard does nothing. The same thing, however,
> works for the other buttons (setting the mnemonic to I for instance).
>
> Questions:
> 1) Why doesnt it work for the button at the top which gets the /Menu
> keyword?

Buttons with the MENU keyword set for them (or, alternatively,
any button in the Menu Bar) do not generate events in IDL.
Or, rather, the events that they generate do not get sent to any
IDL event handler. Hence, you don't know about them. In this case,
you can assign an accelerator and the accelerator probably even
works, you just can't learn about it in your event handler.

> 2) What are the accelerators supposed to do? These entries seem to
> have no effect for any of the buttons.

Accelerators generate events, just as if the user had clicked
the buttons. What effect they have depends upon your event handler
code.

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
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: AND statements
Next Topic: Re: Bug/feature in matrix multiply

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

Current Time: Wed Oct 08 17:10:15 PDT 2025

Total time taken to generate the page: 0.00371 seconds