Exemplo n.º 1
0
    def __init__(self, debug):
        logger.debug("Initializing %s", self.__class__.__name__)
        super().__init__()

        self._init_args = dict(debug=debug)
        self._config = self.initialize_globals()
        self.set_fonts()
        self._config.set_geometry(1200, 640, self._config.user_config_dict["fullscreen"])

        self.wrapper = ProcessWrapper()
        self.objects = dict()

        get_images().delete_preview()
        preview_trigger().clear()
        self.protocol("WM_DELETE_WINDOW", self.close_app)
        self.build_gui()
        self._last_session = LastSession(self._config)
        logger.debug("Initialized %s", self.__class__.__name__)
Exemplo n.º 2
0
    def close_app(self, *args):  # pylint: disable=unused-argument
        """ Close Python. This is here because the graph
            animation function continues to run even when
            tkinter has gone away """
        logger.debug("Close Requested")

        if not self._confirm_close_on_running_task():
            return
        if not self._config.project.confirm_close():
            return

        if self._config.tk_vars["runningtask"].get():
            self.wrapper.task.terminate()

        self._last_session.save()
        get_images().delete_preview()
        preview_trigger().clear()
        self.quit()
        logger.debug("Closed GUI")
        sys.exit(0)