Hello,
I'm currently using xrced to create the GUI and to generate the Python code,
which is working almost perfectly. I'm running into one specific problem, though.
When trying to set up EVT_KILL_FOCUS on a text control in XRCed, it generates
the following code:
self.Bind(wx.EVT_KILL_FOCUS, self.OnKill_focus_TaskTextCtrl,
id=xrc.XRCID('TaskTextCtrl'))
Now, I've been reading around, and the event seems to need to be binded to the
control itself (self.textctrl.Bind vs. self.Bind). However, I can't seem to find
a way to do that while using pywxrc generated python code and an XRC file.
The main program (guibutter.py) is as follows:
import wx
from butterchurn_xrc import *
class ButterChurnAppFrame(xrcButterChurnMainFrame):
def __init__(self, parent):
xrcButterChurnMainFrame.__init__(self, parent)
class ButterChurnApp(wx.App):
def OnInit(self):
self.main_application_frame = ButterChurnAppFrame(None)
self.main_application_frame.Center()
self.main_application_frame.Show(1)
return True
if __name__ == '__main__':
app = ButterChurnApp()
app.MainLoop()
I've tried different ways of doing self.textcontrol.Bind, by trying to rebind it
in guibutter.py and by trying to tweak the butterchurn_xrc.py file directly, but
to no avail.
Any ideas? Feel free to ask any questions if I'm not clear enough.