Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unable to detect wx.FocusEvent on wx.CheckBox with style wx.ALIGN_RIGHT #279

Open
N46AN opened this issue Apr 15, 2017 · 1 comment
Open

Comments

@N46AN
Copy link

N46AN commented Apr 15, 2017

Basic info
wxver - 3.0.3.dev2864+4fc5f9e gtk2 (phoenix)
pyver - Python 3.5.3 (default, Jan 19 2017, 14:11:04) [GCC 6.3.0 20170118] on linux
os-release - Debian GNU/Linux 9 (stretch)

Step to reproduce

  1. Run the following minimal example;
  2. Click the button and the checkbox alternatively, strings 'EVT_SET_FOCUS'/'EVT_KILL_FOCUS' are not printed.
  3. Remove ', style=wx.ALIGN_RIGHT' from self.cb_test and try the above steps again, strings are printed.
import wx

class MainFrame(wx.Frame):
	def __init__(self):
		wx.Frame.__init__(self, parent=None, title='test')
		self.pnl = wx.Panel(parent=self)
		
		self.btn = wx.Button(parent=self.pnl, label='test')
		
		self.cb_test = wx.CheckBox(parent=self.pnl, label='test', style=wx.ALIGN_RIGHT)
		self.cb_test.Bind(wx.EVT_SET_FOCUS, self.onSetFocus)
		self.cb_test.Bind(wx.EVT_KILL_FOCUS, self.onKillFocus)
		
		self.bs = wx.BoxSizer(wx.HORIZONTAL)
		self.bs.Add(self.btn)
		self.bs.Add(self.cb_test)
		self.pnl.SetSizer(self.bs)
		
	def onSetFocus(self, event):
		print('wxEVT_SET_FOCUS')
	
	def onKillFocus(self, event):
		print('wxEVT_KILL_FOCUS')

app = wx.App()
frame = MainFrame()
frame.Show(True)
app.MainLoop()
@RobinD42
Copy link
Member

This is likely a wxWidgets bug. Please create an issue for it at http://trac.wxwidgets.org/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants