Button accelerators [message #451867] |
Wed, 09 March 2005 17:41  |
Eclipse User |
|
|
|
Originally posted by: nightwing812.gmail.com
Is there a simple way to add keyboard accelerators to buttons in swt? I
know that menuItem has as specific method, and I was wondering if there
was something similar for Button.
Brandon
|
|
|
|
|
Re: Button accelerators [message #451934 is a reply to message #451868] |
Thu, 10 March 2005 11:33  |
Eclipse User |
|
|
|
this will work on all platforms
"Robert" <robert_x20032000@yahoo.com> wrote in message
news:d0o1i0$p1l$1@www.eclipse.org...
> Hi,
>
> Indeed, there is no setAccelerator() for a Button. But perhaps something
> like this will do the trick:
>
> Button button = new Button(shell, SWT.PUSH);
> button.setText("&My accelerator"); // note the &
>
> On Windows, this sets the Alt+M accelerator, which causes the button to be
> invoked when the user presses the Alt and 'M' key sequence. Not sure about
> other platforms, though -- this is platform dependant.
>
>
> Brandon Lynch wrote:
>
> > Is there a simple way to add keyboard accelerators to buttons in swt? I
> > know that menuItem has as specific method, and I was wondering if there
> > was something similar for Button.
>
> > Brandon
>
>
|
|
|
Powered by
FUDForum. Page generated in 0.04287 seconds