我们从Python开源项目中,提取了以下11个代码示例,用于说明如何使用wx.InitAllImageHandlers()。
def CreateApplication(self): if os.path.exists("BEREMIZ_DEBUG"): __builtin__.__dict__["BMZ_DBG"] = True else: __builtin__.__dict__["BMZ_DBG"] = False global wx import wx if wx.VERSION >= (3, 0, 0): self.app = wx.App(redirect=BMZ_DBG) else: self.app = wx.PySimpleApp(redirect=BMZ_DBG) self.app.SetAppName('beremiz') if wx.VERSION < (3, 0, 0): wx.InitAllImageHandlers() self.ShowSplashScreen() self.BackgroundInitialization() self.app.MainLoop()
def __do_layout(self): # begin wxGlade: ui_choice2Dialog.__do_layout sizer_1 = wx.BoxSizer(wx.HORIZONTAL) sizer_3 = wx.BoxSizer(wx.VERTICAL) sizer_2 = wx.BoxSizer(wx.VERTICAL) sizer_2.Add(self.numListBox, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 20) sizer_2.Add(self.button_ok, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 10) sizer_1.Add(sizer_2, 1, wx.EXPAND, 0) sizer_3.Add(self.denListBox, 1, wx.ALL|wx.EXPAND|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 20) sizer_3.Add(self.button_cancel, 0, wx.ALL|wx.ALIGN_CENTER_HORIZONTAL|wx.ALIGN_CENTER_VERTICAL, 10) sizer_1.Add(sizer_3, 1, wx.EXPAND, 0) self.SetSizer(sizer_1) self.Layout() # end wxGlade # end of class ui_choice2Dialog #if __name__ == "__main__": #app = wx.PySimpleApp(0) #wx.InitAllImageHandlers() #ChiantiPy = ui_choice2Dialog(None, -1, "") #app.SetTopWindow(ChiantiPy) #ChiantiPy.Show() #app.MainLoop()
def OnInit(self): """Initialise the application""" wx.InitAllImageHandlers() self.frame = frame = wx.Frame( None, ) frame.CreateStatusBar() model = model = self.get_model( sys.argv[1]) self.sq = SquareMap( frame, model=model) EVT_SQUARE_HIGHLIGHTED( self.sq, self.OnSquareSelected ) frame.Show(True) self.SetTopWindow(frame) return True
def __test(): class MyApp(wx.App): def OnInit(self): wx.InitAllImageHandlers() frame = TestFrame(None, -1, "PlotCanvas") # frame.Show(True) self.SetTopWindow(frame) return True app = MyApp(0) app.MainLoop()
def OnInit(self): wx.InitAllImageHandlers() frame_terminal = TerminalFrame(None, -1, "") self.SetTopWindow(frame_terminal) frame_terminal.Show(True) return 1 # end of class MyApp
def OnInit(self): wx.InitAllImageHandlers() ser = serial.Serial() print(ser) # loop until cancel is pressed, old values are used as start for the next run # show the different views, one after the other # value are kept. for flags in (SHOW_BAUDRATE, SHOW_FLOW, SHOW_FORMAT, SHOW_TIMEOUT, SHOW_ALL): dialog_serial_cfg = SerialConfigDialog(None, -1, "", serial=ser, show=flags) self.SetTopWindow(dialog_serial_cfg) result = dialog_serial_cfg.ShowModal() print(ser) if result != wx.ID_OK: break # the user can play around with the values, CANCEL aborts the loop while True: dialog_serial_cfg = SerialConfigDialog(None, -1, "", serial=ser) self.SetTopWindow(dialog_serial_cfg) result = dialog_serial_cfg.ShowModal() print(ser) if result != wx.ID_OK: break return 0 # end of class MyApp
def OnInit(self): wx.InitAllImageHandlers() frame_terminal = TerminalFrame(None, -1, "") self.SetTopWindow(frame_terminal) frame_terminal.Show(1) return 1 # end of class MyApp
def OnInit(self): wx.InitAllImageHandlers() ser = serial.Serial() print ser #loop until cancel is pressed, old values are used as start for the next run #show the different views, one after the other #value are kept. for flags in (SHOW_BAUDRATE, SHOW_FLOW, SHOW_FORMAT, SHOW_TIMEOUT, SHOW_ALL): dialog_serial_cfg = SerialConfigDialog(None, -1, "", serial=ser, show=flags) self.SetTopWindow(dialog_serial_cfg) result = dialog_serial_cfg.ShowModal() print ser if result != wx.ID_OK: break #the user can play around with the values, CANCEL aborts the loop while 1: dialog_serial_cfg = SerialConfigDialog(None, -1, "", serial=ser) self.SetTopWindow(dialog_serial_cfg) result = dialog_serial_cfg.ShowModal() print ser if result != wx.ID_OK: break return 0 # end of class MyApp
def OnInit(self, file=None): """Initialise the application""" wx.InitAllImageHandlers() frame = MainFrame() frame.Show(True) self.SetTopWindow(frame) if file is not None: wx.CallAfter(frame.load, file) elif sys.argv[1:]: wx.CallAfter(frame.load, *sys.argv[1:]) return True
def OnInit(self): wx.InitAllImageHandlers() DrawFrame = BuildDrawFrame() frame = DrawFrame(None, -1, "FloatCanvas Demo App",wx.DefaultPosition,(700,700)) self.SetTopWindow(frame) frame.Show() ## check to see if the demo is set to start in a particular mode. ## fixme: should this be in a dict instead? if StartUpDemo == "text": frame.TestText() elif StartUpDemo == "stext": frame.TestScaledText() elif StartUpDemo == "stextbox": frame.TestScaledTextBox() elif StartUpDemo == "bitmap": frame.TestBitmap() elif StartUpDemo == "all": frame.DrawTest() elif StartUpDemo == "map": frame.DrawMap() elif StartUpDemo == "hit": frame.TestHitTest() elif StartUpDemo == "hitf": frame.TestHitTestForeground() elif StartUpDemo == "animate": frame.TestAnimation() elif StartUpDemo == "speed": frame.SpeedTest() elif StartUpDemo == "temp": frame.TempTest() elif StartUpDemo == "props": frame.PropertiesChangeTest() elif StartUpDemo == "arrow": frame.ArrowTest() elif StartUpDemo == "arrowline": frame.ArrowLineTest() elif StartUpDemo == "hide": frame.HideTest() return True