python类App()的实例源码

gui.py 文件源码 项目:stopgo 作者: notklaatu 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def main(opts):
    app = wx.App(False)
    window = GUI(None, id=1, title="stopgo", style=wx.DEFAULT_FRAME_STYLE | wx.FULL_REPAINT_ON_RESIZE, clargs=opts)
    window.Show()
    app.MainLoop()
    return True
wx_app.py 文件源码 项目:pyopenvr 作者: cmbruns 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def __init__(self, renderer, title="wx test"):
        "Creates an OpenGL context and a window, and acquires OpenGL resources"
        self.renderer = renderer
        self.title = title
        self._is_initialized = False # keep track of whether self.init_gl() has been called
        self.window = None

        wx.App.__init__(self, redirect = False)
run_IRIDA_Uploader.py 文件源码 项目:irida-miseq-uploader 作者: phac-nml 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self, show_new_ui=False, redirect=False, filename=None):
        wx.App.__init__(self, redirect, filename)
        self.get_app_info()
        self.check_for_update()

        user_config_file = path.join(user_config_dir("iridaUploader"), "config.conf")

        if not path.exists(user_config_file):
            dialog = SettingsDialog(first_run=True)
            dialog.ShowModal()

        self._show_main_app()
overlay.py 文件源码 项目:grid 作者: russelg 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def main():
    import config

    app = wx.App()

    for screen in config.GRID:
        x1, y1, x2, y2 = screen
        w = x2 - x1
        h = y2 - y1
        # print screen, w, h
        frm = AppFrame(size=(w, h), pos=(x1, y1))
        frm.ShowWithoutActivating()

    app.MainLoop()
mobile_insight_gui.py 文件源码 项目:mobileinsight-core 作者: mobile-insight 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def main():
    wx.Log.SetLogLevel(0)
    app = wx.App()
    app.frame = WindowClass(None)
    app.MainLoop()
FloatCanvasDemo.py 文件源码 项目:dxf2gcode 作者: cnc-club 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, *args, **kwargs):
            wx.App.__init__(self, *args, **kwargs)
canvas_sample.py 文件源码 项目:dxf2gcode 作者: cnc-club 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def __init__(self,parent,id):
        wx.Frame.__init__(self,parent,id,"Test App")
        self.renderer = Renderer(self)
        self.log = MyTextCtrl(self)
        self.Canvas = MyCanvas(self)

        sizer = wx.BoxSizer()
        sizer.Add(self.Canvas,3,wx.EXPAND)
        sizer.Add(self.log,1,wx.EXPAND)
        self.SetSizer(sizer)

        self.Bind(wx.EVT_CLOSE,self.OnExit)
        self.Show(True)
ExeBuilder.py 文件源码 项目:Crypter 作者: sithis993 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def __init__(self):
        '''
        @summary: Constructor
        '''

        # Initialise the Builder GUI
        app = wx.App()
        builder_gui = Gui()
        builder_gui.Show()
        app.MainLoop()
test_wx.py 文件源码 项目:driveboardapp 作者: nortd 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def main():

    def onKeyDown(event):
        if event.GetKeyCode() == wx.WXK_ESCAPE:
            frame.Close()

    app = wx.App(0)
    frame = wx.Frame(None, title="Hello World from wxPython")
    panel = wx.Panel(frame)
    label = wx.StaticText(panel, -1,
                          u"Press <ESC> to exit. Some non-ascii chars: ??š?íá?")
    panel.Bind(wx.EVT_KEY_DOWN, onKeyDown)
    panel.SetFocus()
    frame.Show()
    app.MainLoop()
ztv.py 文件源码 项目:CAAPR 作者: Stargrazer82301 项目源码 文件源码 阅读 26 收藏 0 点赞 0 评论 0
def __init__(self, title=None, masterPID=-1, launch_listen_thread=False, control_panels_to_load=None,
                 default_data_dir=None, default_autoload_pattern=None):
        self.__version__ = version=about["__version__"]
        WatchMasterPIDThread(masterPID)
        app = wx.App(False)
        self.frame = ZTVFrame(title=title, launch_listen_thread=launch_listen_thread,
                              control_panels_to_load=control_panels_to_load,
                              default_data_dir=default_data_dir, 
                              default_autoload_pattern=default_autoload_pattern)
        app.MainLoop()
        # TODO: need to figure out why ztvframe_pid is being left alive
ztv.py 文件源码 项目:CAAPR 作者: Stargrazer82301 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def __init__(self, title=None, masterPID=-1, launch_listen_thread=False, control_panels_to_load=None,
                 default_data_dir=None, default_autoload_pattern=None):
        self.__version__ = version=about["__version__"]
        WatchMasterPIDThread(masterPID)
        app = wx.App(False)
        self.frame = ZTVFrame(title=title, launch_listen_thread=launch_listen_thread,
                              control_panels_to_load=control_panels_to_load,
                              default_data_dir=default_data_dir, 
                              default_autoload_pattern=default_autoload_pattern)
        app.MainLoop()
        # TODO: need to figure out why ztvframe_pid is being left alive
make_timelapse.py 文件源码 项目:Pigrow 作者: Pragmatismo 项目源码 文件源码 阅读 19 收藏 0 点赞 0 评论 0
def main():
    app = wx.App()
    Make_TL(None)
    app.MainLoop()
config_camera.py 文件源码 项目:Pigrow 作者: Pragmatismo 项目源码 文件源码 阅读 25 收藏 0 点赞 0 评论 0
def main():
    app = wx.App()
    config_cam(None)
    app.MainLoop()
pigrow_remote.py 文件源码 项目:Pigrow 作者: Pragmatismo 项目源码 文件源码 阅读 24 收藏 0 点赞 0 评论 0
def main():
    app = wx.App()
    window = MainApp(None)
    window.Show(True)
    app.MainLoop()
plot.py 文件源码 项目:bonsu 作者: bonsudev 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
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()
debug_util.py 文件源码 项目:cellstar 作者: Fafa87 项目源码 文件源码 阅读 17 收藏 0 点赞 0 评论 0
def explore_cellstar(cellstar=None, seeds=[], snakes=[], images=None, image=None, params=None):
    if explorer_expected():
        value = 0
        try:
            app = None
            try:
                import wx
                app = wx.App(0)
            except:
                pass

            import utils.explorer as exp
            if image is None:
                image = cellstar.images.image
            if images is None:
                images = cellstar.images

            explorer_ui = exp.ExplorerFrame(images)
            explorer = exp.Explorer(image, images, explorer_ui, cellstar, params)
            explorer.stick_seeds = seeds
            explorer.stick_snakes = snakes
            value = explorer_ui.ShowModal()

            #if app is not None:
            #    app.MainLoop()
        except Exception as ex:
            print ex
            pass

        if value == exp.ExplorerFrame.ABORTED:
            raise Exception("Execution aborted")
inputhook.py 文件源码 项目:specto 作者: mrknow 项目源码 文件源码 阅读 20 收藏 0 点赞 0 评论 0
def enable_wx(self, app=None):
        """Enable event loop integration with wxPython.

        Parameters
        ----------
        app : WX Application, optional.
            Running application to use.  If not given, we probe WX for an
            existing application object, and create a new one if none is found.

        Notes
        -----
        This methods sets the ``PyOS_InputHook`` for wxPython, which allows
        the wxPython to integrate with terminal based applications like
        IPython.

        If ``app`` is not given we probe for an existing one, and return it if
        found.  If no existing app is found, we create an :class:`wx.App` as
        follows::

            import wx
            app = wx.App(redirect=False, clearSigInt=False)
        """
        import wx
        from distutils.version import LooseVersion as V
        wx_version = V(wx.__version__).version  # @UndefinedVariable

        if wx_version < [2, 8]:
            raise ValueError("requires wxPython >= 2.8, but you have %s" % wx.__version__)  # @UndefinedVariable

        from pydev_ipython.inputhookwx import inputhook_wx
        self.set_inputhook(inputhook_wx)
        self._current_gui = GUI_WX

        if app is None:
            app = wx.GetApp()  # @UndefinedVariable
        if app is None:
            app = wx.App(redirect=False, clearSigInt=False)  # @UndefinedVariable
        app._in_event_loop = True
        self._apps[GUI_WX] = app
        return app
gui-wx.py 文件源码 项目:specto 作者: mrknow 项目源码 文件源码 阅读 18 收藏 0 点赞 0 评论 0
def OnInit(self):
            frame = MyFrame(None, "Simple wxPython App")
            self.SetTopWindow(frame)

            print("Print statements go to this stdout window by default.")

            frame.Show(True)
            return True
viewer.py 文件源码 项目:pinder 作者: dhharris 项目源码 文件源码 阅读 21 收藏 0 点赞 0 评论 0
def __init__(self, redirect=False):
        '''
        Takes a location as a tuple of the form (LAT, LON)
        '''
        # App fields
        wx.App.__init__(self, redirect)
        self.frame = wx.Frame(None, title='Pinder')

        self.panel = wx.Panel(self.frame)

        self.PhotoMaxSize = 240


        self.createWidgets()
        self.frame.Show()


        # Authenticate Facebook token
        self.login()

        # Start pynder session
        self.start_session()

        # Geopy fields
        self.location = 'Somewhere'
        self.latlon = None

        # Ask for initial location
        self.onChangeLoc(None)

        self.users = []
        self.users_index = 0
        self.hopeful = None
        self.update_user()
UI.py 文件源码 项目:AppAutoViewer 作者: RealLau 项目源码 文件源码 阅读 23 收藏 0 点赞 0 评论 0
def __init__(self):
        screenSize = wx.DisplaySize()
        x = screenSize[0]
        y = screenSize[1]-80
        wx.Frame.__init__(self, None, title="App Auto Viewer",
                          size=(x-80,y))
        self.panel = MainPanel(self)
        self.statusB = self.CreateStatusBar(number=2)
        global recordStatus
        recordStatus = "?"
        self.updateRecordStatus(recordStatus)
        self.statusB.SetStatusText("???    ???", 1)


问题


面经


文章

微信
公众号

扫码关注公众号