Example #1
0
    def __init__(self, context, view, kind, handler, id, scrollable, args):
        """ Initializes the object.
        """
        self.context = context
        self.view = view
        self.kind = kind
        self.handler = handler
        self.id = id
        self.scrollable = scrollable
        self.args = args

        wx.InitAllImageHandlers()

        if os.environ.get('ENABLE_FBI') is not None:
            try:
                from etsdevtools.developer.helper.fbi import enable_fbi
                enable_fbi()
            except:
                pass

        if redirect_filename.strip() != '':
            super(ViewApplication, self).__init__(1, redirect_filename)
        else:
            super(ViewApplication, self).__init__()

        # Start the event loop in an IPython-conforming manner.
        start_event_loop_wx(self)
 def demo_main(demo_class, size=(400, 400), title="Enable Demo"):
     "Takes the class of the demo to run as an argument."
     app = get_app_wx()
     frame = demo_class(None, size=size, title=title)
     app.SetTopWindow(frame)
     start_event_loop_wx(app)
     return frame
Example #3
0
    def __init__(self, context, view, kind, handler, id, scrollable, args):
        """ Initializes the object.
        """
        self.context = context
        self.view = view
        self.kind = kind
        self.handler = handler
        self.id = id
        self.scrollable = scrollable
        self.args = args

        if os.environ.get('ENABLE_FBI') is not None:
            try:
                from etsdevtools.developer.helper.fbi import enable_fbi
                enable_fbi()
            except:
                pass

        if redirect_filename.strip() != '':
            super(ViewApplication, self).__init__(1, redirect_filename)
        else:
            super(ViewApplication, self).__init__(0)

        # Start the event loop in an IPython-conforming manner.
        start_event_loop_wx(self)
Example #4
0
 def demo_main(demo_class, size=(400,400), title="Enable Demo"):
     "Takes the class of the demo to run as an argument."
     app = get_app_wx()
     frame = demo_class(None, size=size, title=title)
     app.SetTopWindow(frame)
     start_event_loop_wx(app)
     return frame
Example #5
0
    def __init__(self, context, view, kind, handler, id, scrollable, args):
        """ Initializes the object.
        """
        self.context = context
        self.view = view
        self.kind = kind
        self.handler = handler
        self.id = id
        self.scrollable = scrollable
        self.args = args

        if redirect_filename.strip() != "":
            super(ViewApplication, self).__init__(1, redirect_filename)
        else:
            super(ViewApplication, self).__init__(0)

        # Start the event loop in an IPython-conforming manner.
        start_event_loop_wx(self)
Example #6
0
    def __init__(self, context, view, kind, handler, id, scrollable, args):
        """Initializes the object."""
        self.context = context
        self.view = view
        self.kind = kind
        self.handler = handler
        self.id = id
        self.scrollable = scrollable
        self.args = args

        if redirect_filename.strip() != "":
            super().__init__(1, redirect_filename)
        else:
            super().__init__(0)

        # Start the event loop in an IPython-conforming manner.
        try:
            start_event_loop_wx(self)
        except Exception:
            logger.exception("Event loop failed to close cleanly:")
Example #7
0
    def start_event_loop(self):
        """ Start the GUI event loop. """

        if self._splash_screen is not None:
            self._splash_screen.close()

        # Make sure that we only set the 'started' trait after the main loop
        # has really started.
        self.set_trait_after(10, self, "started", True)

        # A hack to force menus to appear for applications run on Mac OS X.
        if sys.platform == 'darwin':
            def _mac_os_x_hack():
                f = wx.Frame(None, -1)
                f.Show(True)
                f.Close()
            self.invoke_later(_mac_os_x_hack)

        logger.debug("---------- starting GUI event loop ----------")
        start_event_loop_wx()

        self.started = False
Example #8
0
    def start_event_loop(self):
        """ Start the GUI event loop. """

        if self._splash_screen is not None:
            self._splash_screen.close()

        # Make sure that we only set the 'started' trait after the main loop
        # has really started.
        self.set_trait_after(10, self, "started", True)

        # A hack to force menus to appear for applications run on Mac OS X.
        if sys.platform == 'darwin':

            def _mac_os_x_hack():
                f = wx.Frame(None, -1)
                f.Show(True)
                f.Close()

            self.invoke_later(_mac_os_x_hack)

        logger.debug("---------- starting GUI event loop ----------")
        start_event_loop_wx()

        self.started = False