Accelerators

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Accelerators

Ian Bartholomew-20
Andy/Blair,

I'm not sure if this is the correct behaviour or not so I thought I'd ask
before reporting it.

I am dynamically adding a menu to a Shell using the Menu class>>fromStrings:
method.  I have defined accelerator keys in the correct part of the string,
and they show up in the menu, but pressing the key does nothing.

To get the accelerator to work I have to add an #additionalAccelerator
method to the class.

Is that the expected behaviour?

Regards
    Ian


Reply | Threaded
Open this post in threaded view
|

Re: Accelerators

Blair McGlashan
"Ian Bartholomew" <[hidden email]> wrote in message
news:[hidden email]...

> Andy/Blair,
>
> I'm not sure if this is the correct behaviour or not so I thought I'd ask
> before reporting it.
>
> I am dynamically adding a menu to a Shell using the Menu
> class>>fromStrings: method.  I have defined accelerator keys in the
> correct part of the string, and they show up in the menu, but pressing the
> key does nothing.
>
> To get the accelerator to work I have to add an #additionalAccelerator
> method to the class.
>
> Is that the expected behaviour?

#fromStrings: is a hangover from the days of having hand coded view
definitions. Its useful, I know, for things like IDE extensions, but I
wouldn't be surprised if it didn't do everything you might expect. Raise a
bug report if you like, but I'm afraid it is unlikely to get actioned this
time around. Probably easiest to just send #updateCombinedAcceleratorTable
to the ShellView, or a public way of achieving the same thing would be
'myShellView menuBar: myShellView menuBar'

Regards

Blair


Reply | Threaded
Open this post in threaded view
|

Re: Accelerators

Ian Bartholomew-20
Blair,

> #fromStrings: is a hangover from the days of having hand coded view
> definitions. Its useful, I know, for things like IDE extensions, but I
> wouldn't be surprised if it didn't do everything you might expect. Raise a
> bug report if you like, but I'm afraid it is unlikely to get actioned this
> time around.

It's probably not worth the effort of "fixing" it, I was just unsure
whether it should have worked or not.  As you say, it's an easy way of
creating menus on the fly so having to define the accelerators in a
separate operation is no big deal.

Thanks
        Ian