diff --git a/main.py b/main.py index 807cf48f..30673619 100644 --- a/main.py +++ b/main.py @@ -260,13 +260,13 @@ view.register( # 辞書型で関数を渡しても上手く行かず、仕方なくタプルで渡してる。 # 本当はコメントアウト(以下とview.py内33,34行目)しているようにできたらいいけど、 # _tkinter.TclError: unknown option "-bind_Any_KeyPress"みたいにエラーがでる。 - entry_message_box=None, - # entry_message_box={ - # "bind_Return": messageBoxPressKeyEnter, - # "bind_Any_KeyPress": messageBoxPressKeyAny, - # }, - entry_message_box_bind_Return=messageBoxPressKeyEnter, - entry_message_box_bind_Any_KeyPress=messageBoxPressKeyAny, + # entry_message_box=None, + entry_message_box_commands={ + "bind_Return": messageBoxPressKeyEnter, + "bind_Any_KeyPress": messageBoxPressKeyAny, + }, + # entry_message_box_bind_Return=messageBoxPressKeyEnter, + # entry_message_box_bind_Any_KeyPress=messageBoxPressKeyAny, config_window={ "callback_disable_config_window_compact_mode": callbackEnableConfigWindowCompactMode, diff --git a/view.py b/view.py index 696d597c..3868fde7 100644 --- a/view.py +++ b/view.py @@ -35,7 +35,7 @@ class View(): ) - def register(self, sidebar_features, language_presets, entry_message_box, entry_message_box_bind_Return, entry_message_box_bind_Any_KeyPress, config_window): + def register(self, sidebar_features, language_presets, entry_message_box_commands, config_window): vrct_gui.CALLBACK_TOGGLE_TRANSLATION = sidebar_features["callback_toggle_translation"] vrct_gui.CALLBACK_TOGGLE_TRANSCRIPTION_SEND = sidebar_features["callback_toggle_transcription_send"] @@ -57,10 +57,8 @@ class View(): entry_message_box = getattr(vrct_gui, "entry_message_box") - # entry_message_box.bind("", lambda e: entry_message_box["bind_Return"](e)) - # entry_message_box.bind("", lambda e: entry_message_box["bind_Any_KeyPress"](e)) - entry_message_box.bind("", entry_message_box_bind_Return) - entry_message_box.bind("", entry_message_box_bind_Any_KeyPress) + entry_message_box.bind("", entry_message_box_commands["bind_Return"]) + entry_message_box.bind("", entry_message_box_commands["bind_Any_KeyPress"]) entry_message_box.bind("", self._foregroundOffForcefully) entry_message_box.bind("", self._foregroundOnForcefully)