From: Mattia B. <mat...@li...> - 2005-10-02 23:23:06
|
On Mon, 26 Sep 2005 18:46:16 +0800 Foo Ji-Haw <jh...@ne...> wrote: Hi, > I'm trying to set the accelerator table for my notebook page. Not quite sure where the problem is. Am hoping to get > some advice from the experienced ones (you) instead. Below is my code snippet: > > my $ATable = Wx::AcceleratorTable->new( > [wxACCEL_CTRL,ord('c'),$btnClose], > ); > $this->SetAcceleratorTable($ATable); > ... > EVT_BUTTON ($this,$btnClose,\&onCloseApplication); > > Where $this is a reference to a Wx::Panel object. $btnClose is a Wx::Button. > > I'm trying to assign Alt-C to map to the same event handler as $btnClose. You should try my $ATable = Wx::AcceleratorTable->new( [wxACCEL_CTRL,ord('c'),$btnClose->GetId], ); HTH Mattia |