wx - collapsiblepane.GetLabel() in wxpython -
i'm trying value of label of parent collapsiblepane when checkbox kid clicked. sensible effort have made returns empty string. i'm using python2.6.6 , wx 2.8.12.0 (gtk2-unicode). can't find similar issue anywhere online. have suggestions?
here code i'm using test problem.
import wx class test(wx.frame): def cp(self): cp = wx.collapsiblepane(self, wx.id_any, label="details:") frame_sizer = wx.boxsizer(wx.vertical) frame_sizer.add(cp, 0, wx.grow | wx.all, 5) cp_pane = cp.getpane() cp_sizer = wx.boxsizer(wx.vertical) cb = wx.checkbox(cp_pane, -1, "checkbox", (10, 10)) cb.bind(wx.evt_checkbox, self.onclick) cp_sizer.add(cb) cp_pane.setsizer(cp_sizer) cp_sizer.setsizehints(cp_pane) cp.setlabel("test_label") print cp.getlabel() print cp.getpane().getlabel() print "test" def onclick(self, event): check = event.geteventobject() check_parent = check.getparent() print check_parent.getlabel() if __name__ == '__main__': app = wx.app() gui = test(none) test.cp(gui) gui.show() app.mainloop()
wxpython wx
No comments:
Post a Comment