From 250be654bdbf9ba15a02650c02beede5d9a91098 Mon Sep 17 00:00:00 2001 From: misyaguziya Date: Thu, 31 Aug 2023 23:25:31 +0900 Subject: [PATCH] =?UTF-8?q?[bugfix]=20=E5=A4=89=E6=95=B0=E5=90=8D=E3=81=AE?= =?UTF-8?q?=E8=A2=AB=E3=82=8A=E3=82=92=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 14 +++++++------- view.py | 8 +++----- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/main.py b/main.py index b6bf26b2..66b57119 100644 --- a/main.py +++ b/main.py @@ -260,13 +260,13 @@ view.initializer( # 辞書型で関数を渡しても上手く行かず、仕方なくタプルで渡してる。 # 本当はコメントアウト(以下と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 4fd3d85e..62c065c7 100644 --- a/view.py +++ b/view.py @@ -15,7 +15,7 @@ class View(): pass - def initializer(self, sidebar_features, language_presets, entry_message_box, entry_message_box_bind_Return, entry_message_box_bind_Any_KeyPress, config_window): + def initializer(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"] @@ -37,10 +37,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)