[wxpython-users] Accelerator table and wx.NewId(): bug ?
Robin Dunn
robin at alldunn.com
Mon Sep 8 12:32:17 PDT 2008
Mike Driscoll wrote:
> Hi Diego,
>
>> Hi all.
>>
>> I just noticed that setting an entry in an accelerator table with a
>> custom id (an id that doesn't belong to an existing menu item) doesn't
>> work anymore in wxPython 2.8.8.1 (I tried it with some previous
>> version and it worked):
>>
>> newId = wx.NewId()
>> self.Bind(wx.EVT_MENU, self.OnCtrlQ, id=newId)
>> acct = wx.AcceleratorTable([(wx.ACCEL_CTRL, ord("q"), newId)])
>> self.SetAcceleratorTable(acct)
>>
>> self.OnCtrlQ is never called (I tried all possible variations, such as
>> using "Q", executing the code in __init__ or after the creation of all
>> child controls, and so on).
>>
>> Is that a bug ? If not, is there a solution ?
>> Thanks in advance, Diego.
>>
>>
>
> I'm getting the exact same behavior unless I actually have a menu
> instantiated.
Please create a bug report about this. An accelerator table is supposed
to work without a menubar.
--
Robin Dunn
Software Craftsman
http://wxPython.org Java give you jitters? Relax with wxPython!
More information about the wxpython-users
mailing list