def restart(self): if self.verbose: print_('restart: int_state', self.int_state, 'cmd_state', self.cmd_state) try: tmp = self.sin_table[0] except: self.make_tables(self.nvec) new_state = self.INT_DRAW self.takesvec = self.nvec / self.gcd(self.nvec, self.style) if not self.takesvec & 1 and self.petals & 1: self.takesvec /= 2 if self.cmd_state == self.CMD_GO: if self.minvec > self.takesvec or self.maxvec < self.takesvec: new_state = self.INT_SEARCH self.AppSetTakesVec(self.takesvec) self.AppClear() self.nextpt = self.skipvec self.endpt = min(self.takesvec, self.skipvec + self.drawvec) old_state, self.int_state = self.int_state, new_state if old_state == self.INT_IDLE: # Clock not running self.clock() elif old_state == self.INT_WAIT: # May be long delay, restart self.AppCancelTimer() self.clock() else: return 1 # If called by clock(), return and start clock return 0 # We're in INT_IDLE or INT_WAIT, clock running
def OnSpinback(self, name, value): if verbose: print_('OnSpinback', name, value) if name == 'Style': self.SetStyle(value) elif name == 'Sincr': self.SetSincr(value) elif name == 'Petal': self.SetPetals(value) elif name == 'Pincr': self.SetPincr(value) elif name == 'Vectors': self.SetVectors(value) elif name == 'Minimum': self.SetMinVec(value) elif name == 'Maximum': self.SetMaxVec(value) elif name == 'Skip first': self.SetSkipFirst(value) elif name == 'Draw only': self.SetDrawOnly(value) elif name == 'Vec/tick': self.SetStep(value) elif name == 'msec/tick': self.SetDrawDelay(value) elif name == 'Delay': self.SetWaitDelay(value) else: print_('OnSpinback: Don\'t recognize', name)
def MakeGetTextOutput(self, inputFiles, outputFilename): """ Just output the gettext strings by themselves, with no other code generation. """ outputFile = self._OpenOutputFile(outputFilename) for inFile in inputFiles: resourceDocument = minidom.parse(inFile) resource = resourceDocument.firstChild strings = self.FindStringsInNode(resource) strings = ['_("%s");' % s for s in strings] print_("\n".join(strings), file=outputFile)
def clock(self): if self.int_state == self.INT_IDLE: # print_('clock called in idle state') delay = 0 elif self.int_state == self.INT_DRAW: line, run = self.roselet() self.AppCreateLine(self.rescale(line, self.center, self.scale)) if run: delay = self.draw_delay else: if self.cmd_state == self.CMD_GO: self.int_state = self.INT_WAIT delay = self.wait_delay else: self.int_state = self.INT_IDLE delay = 0 elif self.int_state == self.INT_SEARCH: delay = self.resume() # May call us to start drawing if self.int_state == self.INT_SEARCH: delay = self.draw_delay # but not if searching. elif self.int_state == self.INT_WAIT: if self.cmd_state == self.CMD_GO: delay = self.resume() # Calls us to start drawing else: self.int_state = self.INT_IDLE delay = 0 elif self.int_state == self.INT_RESIZE: # Waiting for resize event stream to settle self.AppSetParam(self.style, self.petals, self.nvec) self.AppSetIncrs(self.sincr, self.pincr) delay = self.restart() # Calls us to start drawing if delay == 0: if self.verbose: print_('clock: going idle from state', self.int_state) else: self.AppAfter(delay, self.clock)
self.SetVectors(value) elif name == 'Minimum': self.SetMinVec(value) elif name == 'Maximum': self.SetMaxVec(value) elif name == 'Skip first': self.SetSkipFirst(value) elif name == 'Draw only': self.SetDrawOnly(value) elif name == 'Vec/tick': self.SetStep(value) elif name == 'msec/tick': self.SetDrawDelay(value) elif name == 'Delay': self.SetWaitDelay(value) else: print_('OnSpinback: Don\'t recognize', name) verbose = 0 # Need some command line options... spin_panels = {} # Hooks to get from rose to panel labels ctrl_buttons = {} # Button widgets for command (NE) panel app = wx.App(False) MyFrame() if verbose: print_('spin_panels', spin_panels.keys()) print_('ctrl_buttons', ctrl_buttons.keys()) app.MainLoop()
def OnPrintTest(self, evt): data = wx.PrintDialogData(self.pdata) dlg = wx.PrintDialog(self, data) if dlg.ShowModal() == wx.ID_OK: data = dlg.GetPrintDialogData() print_() print_("GetFromPage:", data.GetFromPage()) print_("GetToPage:", data.GetToPage()) print_("GetMinPage:", data.GetMinPage()) print_("GetMaxPage:", data.GetMaxPage()) print_("GetNoCopies:", data.GetNoCopies()) print_("GetAllPages:", data.GetAllPages()) print_("GetSelection:", data.GetSelection()) print_("GetCollate:", data.GetCollate()) print_("GetPrintToFile:", data.GetPrintToFile()) self.pdata = wx.PrintData(data.GetPrintData()) print_() print_("GetPrinterName:", self.pdata.GetPrinterName()) dlg.Destroy()
def AppClear(self): if verbose: print_('AppClear: clear screen') self.rose_panel.Clear()
def AppAfter(self, msec, callback): if self.timer_callback: print_('AppAfter: timer_callback already set!') # print_('AppAfter:', callback) self.timer_callback = callback self.timer.Start(msec, True)
def OnGoStop(self, event): if verbose: print_('OnGoStop') self.cmd_go_stop()
def OnBackward(self, event): if verbose: print_('OnBackward') self.cmd_backward()
def OnRedraw(self, event): if verbose: print_('OnRedraw') self.cmd_redraw()
def main(args=None): if not args: args = sys.argv[1:] resourceFilename = "" outputFilename = None embedResources = False generateGetText = False assignVariables = True generatePython = False try: opts, args = getopt.gnu_getopt( args, "hpgevo:", "help python gettext embed novar output=".split()) except getopt.GetoptError as exc: print("\nError : %s\n" % str(exc)) print(__doc__) sys.exit(1) # If there is no input file argument, show help and exit if not args: print(__doc__) print("No xrc input file was specified.") sys.exit(1) # Parse options and arguments for opt, val in opts: if opt in ["-h", "--help"]: print(__doc__) sys.exit(1) if opt in ["-p", "--python"]: generatePython = True if opt in ["-o", "--output"]: outputFilename = val if opt in ["-e", "--embed"]: embedResources = True if opt in ["-v", "--novar"]: assignVariables = False if opt in ["-g", "--gettext"]: generateGetText = True # check for and expand any wildcards in the list of input files inputFiles = [] for arg in args: inputFiles += glob.glob(arg) comp = XmlResourceCompiler() try: if generatePython: if not outputFilename: outputFilename = os.path.splitext(args[0])[0] + "_xrc.py" comp.MakePythonModule(inputFiles, outputFilename, embedResources, generateGetText, assignVariables) elif generateGetText: if not outputFilename: outputFilename = '-' comp.MakeGetTextOutput(inputFiles, outputFilename) else: print(__doc__) print("One or both of -p, -g must be specified.") sys.exit(1) except IOError as exc: print_("%s." % str(exc), file=sys.stderr) else: if outputFilename != "-": print_("Resources written to %s." % outputFilename, file=outputFilename)
def MakePythonModule(self, inputFiles, outputFilename, embedResources=False, generateGetText=False, assignVariables=True): self.blocks = {} self.outputFilename = outputFilename outputFile = self._OpenOutputFile(outputFilename) self.assignVariables = assignVariables classes = [] subclasses = [] resources = [] gettextStrings = [] # process all the inputFiles, collecting the output data for inFile in inputFiles: resourceDocument = minidom.parse(inFile) subclasses.append(self.GenerateSubclasses(resourceDocument)) classes.append(self.GenerateClasses(resourceDocument)) if embedResources: res = self.GenerateInitResourcesEmbedded( inFile, resourceDocument) else: res = self.GenerateInitResourcesFile(inFile, resourceDocument) resources.append(res) if generateGetText: gettextStrings += self.FindStringsInNode( resourceDocument.firstChild) # now write it all out print_(self.templates.FILE_HEADER, file=outputFile) # Note: Technically it is not legal to have anything other # than ascii for class and variable names, but since the user # can create the XML with non-ascii names we'll go ahead and # allow for it here, and then let Python complain about it # later when they try to run the program. if subclasses: subclasses = self.ReplaceBlocks(u"\n".join(subclasses)) print_(subclasses.encode("UTF-8"), file=outputFile) if classes: classes = self.ReplaceBlocks(u"\n".join(classes)) print_(classes.encode("UTF-8"), file=outputFile) print_(self.templates.INIT_RESOURE_HEADER, file=outputFile) if embedResources: print_(self.templates.PREPARE_MEMFS, file=outputFile) resources = u"\n".join(resources) print_(resources.encode("UTF-8"), file=outputFile) if generateGetText: # These have already been converted to utf-8... gettextStrings = [' _("%s")' % s for s in gettextStrings] gettextStrings = "\n".join(gettextStrings) print_(self.templates.GETTEXT_DUMMY_FUNC % gettextStrings, file=outputFile)
def OnForward(self, event): if verbose: print_('OnForward') self.cmd_step()
def OnSpin(self, event): name = self.st.GetLabel() value = self.sc.GetValue() if verbose: print_('OnSpin', name, '=', value) self.callback(name, value) # Call MyFrame.OnSpinback to call clroses
def after(self, a, b, c): print_('Called via wx.CallAfter:', a, b, c)
def __init__(self): def makeSP(name, labels, statictexts=None): panel = wx.Panel(self.side_panel, -1) box = wx.StaticBox(panel, -1, name) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) for name, min_value, value, max_value in labels: sp = SpinPanel(panel, name, min_value, value, max_value, self.OnSpinback) sizer.Add(sp, 0, wx.EXPAND) if statictexts: for name, text in statictexts: st = wx.StaticText(panel, -1, text) spin_panels[name] = st # Supposed to be a SpinPanel.... sizer.Add(st, 0, wx.EXPAND) panel.SetSizer(sizer) return panel wx.Frame.__init__(self, None, title="Roses in wxPython") self.rose_panel = RosePanel(self) self.side_panel = wx.Panel(self) # The cmd panel is four buttons whose names and foreground colors # change. Plop them in a StaticBox like the SpinPanels. Use # a 2x2 grid, but StaticBoxSizer can't handle that. Therefore, # create a sub panel, layout the buttons there, then give that to # a higher panel that has the static box stuff. self.cmd_panel = wx.Panel(self.side_panel, -1) box = wx.StaticBox(self.cmd_panel, -1, 'Command') self.sub_panel = wx.Panel(self.cmd_panel, -1) sizer = wx.GridSizer(rows=2, cols=2, vgap=4, hgap=4) global ctrl_buttons border = 'wxMac' in wx.PlatformInfo and 3 or 1 for name, handler in (('Go', self.OnGoStop), ('Redraw', self.OnRedraw), ('Backward', self.OnBackward), ('Forward', self.OnForward)): button = wx.Button(self.sub_panel, -1, name) button.SetForegroundColour(self.labelColours[name]) ctrl_buttons[name] = button button.Bind(wx.EVT_BUTTON, handler) sizer.Add(button, 0, wx.EXPAND | wx.ALL, border) self.sub_panel.SetSizer(sizer) # Set up cmd_panel with StaticBox stuff sizer = wx.StaticBoxSizer(box, wx.VERTICAL) sizer.Add(self.sub_panel) self.cmd_panel.SetSizer(sizer) # Now make the rest of the control panels... # The order of creation of SpinCtrls and Buttons is the order that # the tab key will step through, so the order of panel creation is # important. # In the SpinPanel data (name, min, value, max), value will be # overridden by clroses.py defaults. self.coe_panel = makeSP('Coefficient', (('Style', 0, 100, 3600), ('Sincr', -3600, -1, 3600), ('Petal', 0, 2, 3600), ('Pincr', -3600, 1, 3600))) self.vec_panel = makeSP( 'Vector', (('Vectors', 1, 399, 3600), ('Minimum', 1, 1, 3600), ('Maximum', 1, 3600, 3600), ('Skip first', 0, 0, 3600), ('Draw only', 1, 3600, 3600)), (('Takes', 'Takes 0000 vectors'), )) self.tim_panel = makeSP('Timing', (('Vec/tick', 1, 20, 3600), ('msec/tick', 1, 50, 1000), ('Delay', 1, 2000, 9999))) self.opt_panel = OptionsPanel(self.side_panel, self.rose_panel) # put them all on in a sizer attached to the side_panel panelSizer = wx.BoxSizer(wx.VERTICAL) panelSizer.Add(self.cmd_panel, 0, wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, 5) panelSizer.Add(self.coe_panel, 0, wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, 5) panelSizer.Add(self.vec_panel, 0, wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, 5) panelSizer.Add(self.tim_panel, 0, wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, 5) panelSizer.Add(self.opt_panel, 0, wx.EXPAND | wx.TOP | wx.LEFT | wx.RIGHT, 5) self.side_panel.SetSizer(panelSizer) # and now arrange the two main panels in another sizer for the frame mainSizer = wx.BoxSizer(wx.HORIZONTAL) mainSizer.Add(self.rose_panel, 1, wx.EXPAND) mainSizer.Add(self.side_panel, 0, wx.EXPAND) self.SetSizer(mainSizer) # bind event handlers self.timer = wx.Timer(self) self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer) # Determine appropriate image size. # At this point, the rose_panel and side_panel will both report # size (20, 20). After mainSizer.Fit(self) they will report the # same, but the Frame size, self.GetSize(), will report the desired # side panel dimensions plus an extra 20 on the width. That lets # us determine the frame size that will display the side panel and # a square space for the diagram. Only after Show() will the two # panels report the accurate sizes. mainSizer.Fit(self) rw, rh = self.rose_panel.GetSize() sw, sh = self.side_panel.GetSize() fw, fh = self.GetSize() h = max(600, fh) # Change 600 to desired minimum size w = h + fw - rw if verbose: print_('rose panel size', (rw, rh)) print_('side panel size', (sw, sh)) print_(' frame size', (fw, fh)) print_('Want size', (w, h)) self.SetSize((w, h)) self.SupplyControlValues() # Ask clroses to tell us all the defaults self.Show()
def OnInit(self): print_('OnInit') frm = MyFrame(None, title="Hello with Events", size=(480,360)) frm.Show() return True
def __init__(self): def makeSP(name, labels, statictexts = None): panel = wx.Panel(self.side_panel, -1) box = wx.StaticBox(panel, -1, name) sizer = wx.StaticBoxSizer(box, wx.VERTICAL) for name, min_value, value, max_value in labels: sp = SpinPanel(panel, name, min_value, value, max_value, self.OnSpinback) sizer.Add(sp, 0, wx.EXPAND) if statictexts: for name, text in statictexts: st = wx.StaticText(panel, -1, text) spin_panels[name] = st # Supposed to be a SpinPanel.... sizer.Add(st, 0, wx.EXPAND) panel.SetSizer(sizer) return panel wx.Frame.__init__(self, None, title="Roses in wxPython") self.rose_panel = RosePanel(self) self.side_panel = wx.Panel(self) # The cmd panel is four buttons whose names and foreground colors # change. Plop them in a StaticBox like the SpinPanels. Use # a 2x2 grid, but StaticBoxSizer can't handle that. Therefore, # create a sub panel, layout the buttons there, then give that to # a higher panel that has the static box stuff. self.cmd_panel = wx.Panel(self.side_panel, -1) box = wx.StaticBox(self.cmd_panel, -1, 'Command') self.sub_panel = wx.Panel(self.cmd_panel, -1) sizer = wx.GridSizer(rows=2, cols=2, vgap=4, hgap=4) global ctrl_buttons border = 'wxMac' in wx.PlatformInfo and 3 or 1 for name, handler in ( ('Go', self.OnGoStop), ('Redraw', self.OnRedraw), ('Backward', self.OnBackward), ('Forward', self.OnForward)): button = wx.Button(self.sub_panel, -1, name) button.SetForegroundColour(self.labelColours[name]) ctrl_buttons[name] = button button.Bind(wx.EVT_BUTTON, handler) sizer.Add(button, 0, wx.EXPAND|wx.ALL, border) self.sub_panel.SetSizer(sizer) # Set up cmd_panel with StaticBox stuff sizer = wx.StaticBoxSizer(box, wx.VERTICAL) sizer.Add(self.sub_panel) self.cmd_panel.SetSizer(sizer) # Now make the rest of the control panels... # The order of creation of SpinCtrls and Buttons is the order that # the tab key will step through, so the order of panel creation is # important. # In the SpinPanel data (name, min, value, max), value will be # overridden by clroses.py defaults. self.coe_panel = makeSP('Coefficient', (('Style', 0, 100, 3600), ('Sincr', -3600, -1, 3600), ('Petal', 0, 2, 3600), ('Pincr', -3600, 1, 3600))) self.vec_panel = makeSP('Vector', (('Vectors' , 1, 399, 3600), ('Minimum' , 1, 1, 3600), ('Maximum' , 1, 3600, 3600), ('Skip first', 0, 0, 3600), ('Draw only' , 1, 3600, 3600)), (('Takes', 'Takes 0000 vectors'), )) self.tim_panel = makeSP('Timing', (('Vec/tick' , 1, 20, 3600), ('msec/tick', 1, 50, 1000), ('Delay' , 1, 2000, 9999))) self.opt_panel = OptionsPanel(self.side_panel, self.rose_panel) # put them all on in a sizer attached to the side_panel panelSizer = wx.BoxSizer(wx.VERTICAL) panelSizer.Add(self.cmd_panel, 0, wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT, 5) panelSizer.Add(self.coe_panel, 0, wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT, 5) panelSizer.Add(self.vec_panel, 0, wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT, 5) panelSizer.Add(self.tim_panel, 0, wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT, 5) panelSizer.Add(self.opt_panel, 0, wx.EXPAND|wx.TOP|wx.LEFT|wx.RIGHT, 5) self.side_panel.SetSizer(panelSizer) # and now arrange the two main panels in another sizer for the frame mainSizer = wx.BoxSizer(wx.HORIZONTAL) mainSizer.Add(self.rose_panel, 1, wx.EXPAND) mainSizer.Add(self.side_panel, 0, wx.EXPAND) self.SetSizer(mainSizer) # bind event handlers self.timer = wx.Timer(self) self.Bind(wx.EVT_TIMER, self.OnTimer, self.timer) # Determine appropriate image size. # At this point, the rose_panel and side_panel will both report # size (20, 20). After mainSizer.Fit(self) they will report the # same, but the Frame size, self.GetSize(), will report the desired # side panel dimensions plus an extra 20 on the width. That lets # us determine the frame size that will display the side panel and # a square space for the diagram. Only after Show() will the two # panels report the accurate sizes. mainSizer.Fit(self) rw, rh = self.rose_panel.GetSize() sw, sh = self.side_panel.GetSize() fw, fh = self.GetSize() h = max(600, fh) # Change 600 to desired minimum size w = h + fw - rw if verbose: print_('rose panel size', (rw, rh)) print_('side panel size', (sw, sh)) print_(' frame size', (fw, fh)) print_('Want size', (w,h)) self.SetSize((w, h)) self.SupplyControlValues() # Ask clroses to tell us all the defaults self.Show()
import wx from wx.lib.six import print_ print_(wx.version()) #import os; print_('PID:', os.getpid()); raw_input('Ready to start, press enter...') class MyFrame(wx.Frame): def __init__(self, *args, **kw): wx.Frame.__init__(self, *args, **kw) self.Bind(wx.EVT_SIZE, self.onSize) wx.CallAfter(self.after, 1, 2, 3) def after(self, a, b, c): print_('Called via wx.CallAfter:', a, b, c) def onSize(self, evt): print_(repr(evt.Size)) evt.Skip() class MyApp(wx.App): def OnInit(self): print_('OnInit') frm = MyFrame(None, title="Hello with Events", size=(480,360)) frm.Show() return True def OnExit(self): print_('OnExit') return 0
def MakePythonModule(self, inputFiles, outputFilename, embedResources=False, generateGetText=False, assignVariables=True): self.blocks = {} self.outputFilename = outputFilename outputFile = self._OpenOutputFile(outputFilename) self.assignVariables = assignVariables classes = [] subclasses = [] resources = [] gettextStrings = [] # process all the inputFiles, collecting the output data for inFile in inputFiles: resourceDocument = minidom.parse(inFile) subclasses.append(self.GenerateSubclasses(resourceDocument)) classes.append(self.GenerateClasses(resourceDocument)) if embedResources: res = self.GenerateInitResourcesEmbedded(inFile, resourceDocument) else: res = self.GenerateInitResourcesFile(inFile, resourceDocument) resources.append(res) if generateGetText: gettextStrings += self.FindStringsInNode(resourceDocument.firstChild) # now write it all out print_(self.templates.FILE_HEADER, file=outputFile) # Note: Technically it is not legal to have anything other # than ascii for class and variable names, but since the user # can create the XML with non-ascii names we'll go ahead and # allow for it here, and then let Python complain about it # later when they try to run the program. if subclasses: subclasses = self.ReplaceBlocks(u"\n".join(subclasses)) print_(subclasses.encode("UTF-8"), file=outputFile) if classes: classes = self.ReplaceBlocks(u"\n".join(classes)) print_(classes.encode("UTF-8"), file=outputFile) print_(self.templates.INIT_RESOURE_HEADER, file=outputFile) if embedResources: print_(self.templates.PREPARE_MEMFS, file=outputFile) resources = u"\n".join(resources) print_(resources.encode("UTF-8"), file=outputFile) if generateGetText: # These have already been converted to utf-8... gettextStrings = [' _("%s")' % s for s in gettextStrings] gettextStrings = "\n".join(gettextStrings) print_(self.templates.GETTEXT_DUMMY_FUNC % gettextStrings, file=outputFile)
def onSize(self, evt): print_(repr(evt.Size)) evt.Skip()
def main(args=None): if not args: args = sys.argv[1:] resourceFilename = "" outputFilename = None embedResources = False generateGetText = False assignVariables = True generatePython = False try: opts, args = getopt.gnu_getopt(args, "hpgevo:", "help python gettext embed novar output=".split()) except getopt.GetoptError as exc: print("\nError : %s\n" % str(exc)) print(__doc__) sys.exit(1) # If there is no input file argument, show help and exit if not args: print(__doc__) print("No xrc input file was specified.") sys.exit(1) # Parse options and arguments for opt, val in opts: if opt in ["-h", "--help"]: print(__doc__) sys.exit(1) if opt in ["-p", "--python"]: generatePython = True if opt in ["-o", "--output"]: outputFilename = val if opt in ["-e", "--embed"]: embedResources = True if opt in ["-v", "--novar"]: assignVariables = False if opt in ["-g", "--gettext"]: generateGetText = True # check for and expand any wildcards in the list of input files inputFiles = [] for arg in args: inputFiles += glob.glob(arg) comp = XmlResourceCompiler() try: if generatePython: if not outputFilename: outputFilename = os.path.splitext(args[0])[0] + "_xrc.py" comp.MakePythonModule(inputFiles, outputFilename, embedResources, generateGetText, assignVariables) elif generateGetText: if not outputFilename: outputFilename = '-' comp.MakeGetTextOutput(inputFiles, outputFilename) else: print(__doc__) print("One or both of -p, -g must be specified.") sys.exit(1) except IOError as exc: print_("%s." % str(exc), file=sys.stderr) else: if outputFilename != "-": print_("Resources written to %s." % outputFilename, file=outputFilename)
def OnExit(self): print_('OnExit') return 0
elif name == 'Vectors': self.SetVectors(value) elif name == 'Minimum': self.SetMinVec(value) elif name == 'Maximum': self.SetMaxVec(value) elif name == 'Skip first': self.SetSkipFirst(value) elif name == 'Draw only': self.SetDrawOnly(value) elif name == 'Vec/tick': self.SetStep(value) elif name == 'msec/tick': self.SetDrawDelay(value) elif name == 'Delay': self.SetWaitDelay(value) else: print_('OnSpinback: Don\'t recognize', name) verbose = 0 # Need some command line options... spin_panels = {} # Hooks to get from rose to panel labels ctrl_buttons = {} # Button widgets for command (NE) panel app = wx.App(False) MyFrame() if verbose: print_('spin_panels', spin_panels.keys()) print_('ctrl_buttons', ctrl_buttons.keys()) app.MainLoop()