diff --git a/etg/tglbtn.py b/etg/tglbtn.py index 907412ae..f5112ce3 100644 --- a/etg/tglbtn.py +++ b/etg/tglbtn.py @@ -33,6 +33,8 @@ def run(): # Tweak the parsed meta objects in the module object as needed for # customizing the generated code and docstrings. + module.addHeaderCode("#include ") + c = module.find('wxToggleButton') c.find('wxToggleButton.label').default = 'wxEmptyString' c.find('Create.label').default = 'wxEmptyString' @@ -43,6 +45,9 @@ def run(): c.find('Create.label').default = 'wxNullBitmap' tools.fixWindowClass(c) + module.addPyCode("""\ + EVT_TOGGLEBUTTON = PyEventBinder(wxEVT_COMMAND_TOGGLEBUTTON_CLICKED, 1)""") + #----------------------------------------------------------------- tools.doCommonTweaks(module) tools.runGenerators(module) diff --git a/unittests/test_tglbtn.py b/unittests/test_tglbtn.py index 171fdf78..f345dc72 100644 --- a/unittests/test_tglbtn.py +++ b/unittests/test_tglbtn.py @@ -14,7 +14,6 @@ class tglbtn_Tests(wtc.WidgetTestCase): btn = wx.ToggleButton(self.frame, -1, 'label', (10,10), (100,-1), wx.BU_LEFT) bmp = wx.Bitmap(pngFile) btn.SetBitmap(bmp) - def test_ButtonDefaultCtor(self): @@ -22,7 +21,11 @@ class tglbtn_Tests(wtc.WidgetTestCase): btn.Create(self.frame, -1, 'button label') + def test_ButtonDefaultEvt(self): + wx.wxEVT_COMMAND_TOGGLEBUTTON_CLICKED + wx.EVT_TOGGLEBUTTON + #---------------------------------------------------------------------------