예제 #1
0
    def __init__(self, *args, config=None, **kwargs):
        super().__init__(*args, **kwargs)

        # Hide Tkinter root window
        self.withdraw()

        # Load config
        self.config = config

        if not self.config:
            self.config = Config()

        # On Windows, set DPI awareness
        if platform.system() == "Windows":
            self._windows_set_dpi_awareness()

        # Set Automagica icon
        icon_path = os.path.join(
            os.path.abspath(__file__).replace(
                os.path.basename(os.path.realpath(__file__)), ""),
            "icons",
            "automagica.ico",
        )
        self.tk.call(
            "wm",
            "iconphoto",
            self._w,
            ImageTk.PhotoImage(Image.open(icon_path)),
        )

        ICONS.generate_icons()
예제 #2
0
    def __init__(self, *args, config=None, **kwargs):
        super().__init__(*args, **kwargs)

        # Hide this parent window
        self.withdraw()

        # Load config
        self.config = config

        if not self.config:
            self.config = Config()

        # On Windows, set DPI awareness
        if platform.system() == "Windows":
            self._windows_set_dpi_awareness()

        ICONS.generate_icons()