class TestApp(wx.App): """Basic application for holding the viewing Frame""" handler = wx.PNGHandler() def OnInit(self): """Initialise the application""" wx.Image.AddHandler(self.handler) self.frame = frame = wx.Frame(None, ) frame.CreateStatusBar() model = model = self.get_model(sys.argv[1]) self.sq = squaremap.SquareMap( frame, model=model, adapter=MeliaeAdapter(), padding=2, margin=1, square_style=True, ) squaremap.EVT_SQUARE_HIGHLIGHTED(self.sq, self.OnSquareSelected) frame.Show(True) self.SetTopWindow(frame) return True def get_model(self, path): return meliaeloader.load(path)[0] # tree-only def OnSquareSelected(self, event): text = self.sq.adapter.label(event.node) self.frame.SetToolTip(text)
def __init__(self): super().__init__(False, useBestVisual=True) # Do additional groundwork self.__path = os.path.dirname(sys.argv[0]) wx.FileSystem.AddHandler(wx.MemoryFSHandler()) wx.Image.AddHandler(wx.PNGHandler())
def OnInit(self): wx.Image_AddHandler(wx.JPEGHandler()) wx.Image_AddHandler(wx.PNGHandler()) wx.Image_AddHandler(wx.GIFHandler()) frame = DemoFrame(None) frame.Show(True) self.SetTopWindow(frame) return True
def OnInit(self): wx.Image.AddHandler(wx.PNGHandler()) self.SetVendorName("SPT-Team") self.SetAppName("EI07") wx.FileConfig.Get() return True
def test_imageHandlerStandardDerivations(self): # checks that all of the standard wx derivations are available. wx.GIFHandler() wx.IFFHandler() wx.JPEGHandler() wx.PCXHandler() wx.PNGHandler() wx.PNMHandler() wx.TGAHandler() wx.TIFFHandler() wx.XPMHandler()
def OnInit(self): """ Start the game """ #import locale #self.locale = wx.Locale(wx.LANGUAGE_FRENCH) #locale.setlocale(locale.LC_ALL, 'fr') wx.Image_AddHandler(wx.PNGHandler()) frame = PokerFrame(None) frame.Show(True) self.SetTopWindow(frame) #wx.InitAllImageHandlers() return True
class MeliaeViewApp(wx.App): handler = wx.PNGHandler() def OnInit(self): """Initialise the application""" wx.Image.AddHandler(self.handler) frame = MainFrame( config_parser = load_config()) frame.Show(True) self.SetTopWindow(frame) if sys.argv[1:]: wx.CallAfter( frame.load_memory, sys.argv[1] ) else: log.warn( 'No memory file specified' ) return True
class RunSnakeRunApp(wx.App): """Basic application for holding the viewing Frame""" handler = wx.PNGHandler() def OnInit(self): """Initialise the application""" wx.Image.AddHandler(self.handler) frame = MainFrame( config_parser = load_config()) frame.Show(True) self.SetTopWindow(frame) if sys.argv[1:]: if sys.argv[1] == '-m': if sys.argv[2:]: wx.CallAfter( frame.load_memory, sys.argv[2] ) else: log.warn( 'No memory file specified' ) else: wx.CallAfter(frame.load, *sys.argv[1:]) return True
if colors != 0: color = copy.deepcopy(color) if colors == 1: color.alter(colorStep) else: color.randomize() def run(self, event): size = 0 while size < 1000: size += self.worms[self.index].draw(self.mdc) self.index += 1 if self.index >= len(self.worms): self.index = 0 dc = wx.PaintDC(self) w, h = self.mdc.GetSize() dc.Blit(0, 0, w, h, self.mdc, 0, 0) self.handle_request() def on_quit(self, event): self.timer.Stop() self.Destroy() if __name__ == '__main__': wx.Image.AddHandler(wx.PNGHandler()) app = wx.PySimpleApp() main = Main() app.MainLoop()