withdrawのタイミングを修正

This commit is contained in:
misygauziya
2023-07-13 15:43:44 +09:00
parent 88155e5b01
commit d11f9d716f
2 changed files with 3 additions and 2 deletions

View File

@@ -398,11 +398,9 @@ class App(CTk):
self.protocol("WM_DELETE_WINDOW", self.delete_window) self.protocol("WM_DELETE_WINDOW", self.delete_window)
self.config_window = ToplevelWindowConfig(self) self.config_window = ToplevelWindowConfig(self)
self.config_window.withdraw()
def button_config_callback(self): def button_config_callback(self):
# if self.config_window is None or not self.config_window.winfo_exists(): # if self.config_window is None or not self.config_window.winfo_exists():
# # self.config_window = ToplevelWindowConfig(self)
self.config_window.deiconify() self.config_window.deiconify()
self.checkbox_translation.configure(state="disabled") self.checkbox_translation.configure(state="disabled")
self.checkbox_transcription_send.configure(state="disabled") self.checkbox_transcription_send.configure(state="disabled")

View File

@@ -16,6 +16,7 @@ class ToplevelWindowConfig(CTkToplevel):
def __init__(self, parent, *args, **kwargs): def __init__(self, parent, *args, **kwargs):
super().__init__(parent, *args, **kwargs) super().__init__(parent, *args, **kwargs)
self.withdraw()
self.parent = parent self.parent = parent
# self.geometry(f"{350}x{270}") # self.geometry(f"{350}x{270}")
# self.resizable(False, False) # self.resizable(False, False)
@@ -167,6 +168,7 @@ class ToplevelWindowConfig(CTkToplevel):
save_json(self.parent.PATH_CONFIG, "FONT_FAMILY", self.parent.FONT_FAMILY) save_json(self.parent.PATH_CONFIG, "FONT_FAMILY", self.parent.FONT_FAMILY)
def optionmenu_ui_language_callback(self, choice): def optionmenu_ui_language_callback(self, choice):
self.withdraw()
pre_language_yaml_data = get_localized_text(f"{self.parent.UI_LANGUAGE}") pre_language_yaml_data = get_localized_text(f"{self.parent.UI_LANGUAGE}")
self.parent.UI_LANGUAGE = get_key_by_value(selectable_languages, choice) self.parent.UI_LANGUAGE = get_key_by_value(selectable_languages, choice)
language_yaml_data = get_localized_text(f"{self.parent.UI_LANGUAGE}") language_yaml_data = get_localized_text(f"{self.parent.UI_LANGUAGE}")
@@ -186,6 +188,7 @@ class ToplevelWindowConfig(CTkToplevel):
# self.parent.information_window.textbox_information.configure(font=customtkinter.CTkFont(family=choice)) # self.parent.information_window.textbox_information.configure(font=customtkinter.CTkFont(family=choice))
# except: # except:
# pass # pass
self.deiconify()
def optionmenu_translation_translator_callback(self, choice): def optionmenu_translation_translator_callback(self, choice):
if self.parent.translator.authentication(choice, self.parent.AUTH_KEYS[choice]) is False: if self.parent.translator.authentication(choice, self.parent.AUTH_KEYS[choice]) is False: