[wxPython-users] Re: button disable swallows focus

Robin Dunn robin at alldunn.com
Wed Aug 30 15:24:13 PDT 2006


Donn Ingle wrote:
> Robin Dunn wrote:

>> If you
>> don't have a menubar then you can so the same thing by creating a
>> wx.AcceleratorTable and assigning it to the frame.
> Indeed, at the moment it is a very simple window sans menubar.
> I read page 308 to 310 in your book and it seems the AcceleratorTable is
> tied-into menu items.
> What would I say given I don't use a menu:
> (in my frame)
> self.accel = wx.AcceleratorTable(wx.ACCEL_NORMAL, wx.WXK_ESCAPE,???)

It still sends menu events, so this should do it:

	ID_ESC = wx.NewId()
	self.accel = wx.AcceleratorTable(wx.ACCEL_NORMAL, wx.WXK_ESCAPE, ID_ESC)
	frame.SetAcceleratorTable(self.accel)
	frame.Bind(wx.EVT_MENU, self.OnHandleESC, id=ID_ESC)


-- 
Robin Dunn
Software Craftsman
http://wxPython.org  Java give you jitters?  Relax with wxPython!





More information about the wxpython-users mailing list