From 7c23adfc244108a1e2bd875e4753fba2320cd0fc Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 29 Dec 2023 01:24:54 +0900 Subject: [PATCH 1/2] =?UTF-8?q?[Update]=20Main=20Window:=20Message=20Box.?= =?UTF-8?q?=20=E3=83=A1=E3=83=83=E3=82=BB=E3=83=BC=E3=82=B8=E5=85=A5?= =?UTF-8?q?=E5=8A=9B=E6=AC=84=E3=81=AE=E3=82=B5=E3=82=A4=E3=82=BA=E3=82=92?= =?UTF-8?q?=E5=A4=89=E6=9B=B4=E3=81=A7=E3=81=8D=E3=82=8B=E3=82=88=E3=81=86?= =?UTF-8?q?=E3=81=AB=E3=80=82=E5=8E=B3=E5=AF=86=E3=81=AA=E8=A8=88=E7=AE=97?= =?UTF-8?q?=E3=81=AF=E3=81=97=E3=81=A6=E3=81=BE=E3=81=9B=E3=82=93=E3=80=82?= =?UTF-8?q?=20=E3=80=90=E8=A6=8B=E3=81=9F=E7=9B=AE=E3=81=B8=E3=81=AE?= =?UTF-8?q?=E5=BD=B1=E9=9F=BF=E5=A4=A7=E3=80=91=E3=83=87=E3=83=95=E3=82=A9?= =?UTF-8?q?=E3=83=AB=E3=83=88=E3=81=AE=E3=83=81=E3=83=A3=E3=83=83=E3=83=88?= =?UTF-8?q?=E5=85=A5=E5=8A=9B=E6=AC=84=E3=82=92=E5=B0=91=E3=81=97=E5=A4=A7?= =?UTF-8?q?=E3=81=8D=E3=81=8F=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= =?UTF-8?q?=EF=BC=88=E3=82=82=E3=81=A1=E3=82=8D=E3=82=93=E5=A4=89=E6=9B=B4?= =?UTF-8?q?=E3=81=A7=E3=81=8D=E3=82=8B=EF=BC=89=20=E3=83=86=E3=82=AD?= =?UTF-8?q?=E3=82=B9=E3=83=88=E3=83=9C=E3=83=83=E3=82=AF=E3=82=B9=E3=81=A8?= =?UTF-8?q?=E3=81=AE=E6=AF=94=E7=8E=87=E3=81=A8=E3=81=97=E3=81=A6=E3=81=84?= =?UTF-8?q?=E3=82=8B=E3=81=AE=E3=81=A7=E3=80=81Window=E3=82=B5=E3=82=A4?= =?UTF-8?q?=E3=82=BA=E3=82=92=E5=A4=89=E6=9B=B4=E3=81=99=E3=82=8B=E3=81=A8?= =?UTF-8?q?=E3=80=81=E3=81=9D=E3=82=8C=E3=81=AB=E5=90=88=E3=82=8F=E3=81=9B?= =?UTF-8?q?=E3=81=A6=E5=8F=AF=E5=A4=89=E3=81=97=E3=81=BE=E3=81=99=E3=80=82?= =?UTF-8?q?=20CTkEntry=E3=81=8B=E3=82=89CTkTextbox=E3=81=AB=E5=A4=89?= =?UTF-8?q?=E6=9B=B4=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82=E3=83=97?= =?UTF-8?q?=E3=83=AC=E3=83=BC=E3=82=B9=E3=83=9B=E3=83=AB=E3=83=80=E3=83=BC?= =?UTF-8?q?=E3=81=AE=E4=BD=BF=E7=94=A8=E3=81=8C=E5=8E=B3=E3=81=97=E3=81=8F?= =?UTF-8?q?=E3=81=AA=E3=81=A3=E3=81=9F=E3=81=AE=E3=81=A7=E5=BB=83=E6=AD=A2?= =?UTF-8?q?=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82=E6=9C=80=E5=B0=8F?= =?UTF-8?q?=E3=81=AB=E3=81=97=E3=81=A6=E3=82=82=E3=80=81=E5=85=A5=E5=8A=9B?= =?UTF-8?q?=E4=B8=AD=E3=81=AE=E4=BD=8D=E7=BD=AE=E3=81=8C=E4=B8=AD=E5=A4=AE?= =?UTF-8?q?=E3=81=AB=E3=81=AA=E3=82=89=E3=81=AA=E3=81=84=E3=81=AA=E3=81=A9?= =?UTF-8?q?=E3=80=81=E3=83=87=E3=82=B6=E3=82=A4=E3=83=B3=E3=81=8C=E8=8B=A5?= =?UTF-8?q?=E5=B9=B2=E5=B4=A9=E3=82=8C=E3=81=BE=E3=81=97=E3=81=9F=E3=81=8C?= =?UTF-8?q?=E8=A8=B1=E5=AE=B9=E3=81=97=E3=81=BE=E3=81=97=E3=81=9F=E3=80=82?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.py | 12 +++++++ controller.py | 8 ++++- locales/en.yml | 4 +++ locales/ja.yml | 4 +++ view.py | 33 +++++++++++++++++-- vrct_gui/_changeMainWindowWidgetsStatus.py | 6 ++-- .../createSettingBox_Appearance.py | 16 +++++++++ .../widgets/create_entry_message_box.py | 13 ++++---- .../main_window/widgets/create_textbox.py | 1 + vrct_gui/ui_managers/UiScalingManager.py | 3 +- 10 files changed, 85 insertions(+), 15 deletions(-) diff --git a/config.py b/config.py index b0149e64..a7f2401b 100644 --- a/config.py +++ b/config.py @@ -244,6 +244,17 @@ class Config: self._TEXTBOX_UI_SCALING = value saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) + @property + @json_serializable('MESSAGE_BOX_RATIO') + def MESSAGE_BOX_RATIO(self): + return self._MESSAGE_BOX_RATIO + + @MESSAGE_BOX_RATIO.setter + def MESSAGE_BOX_RATIO(self, value): + if isinstance(value, int) and 1 <= value <= 99: + self._MESSAGE_BOX_RATIO = value + saveJson(self.PATH_CONFIG, inspect.currentframe().f_code.co_name, value) + @property @json_serializable('FONT_FAMILY') def FONT_FAMILY(self): @@ -626,6 +637,7 @@ class Config: self._APPEARANCE_THEME = "System" self._UI_SCALING = "100%" self._TEXTBOX_UI_SCALING = 100 + self._MESSAGE_BOX_RATIO = 10 self._FONT_FAMILY = "Yu Gothic UI" self._UI_LANGUAGE = "en" self._CHOICE_MIC_HOST = getDefaultInputDevice()["host"]["name"] diff --git a/controller.py b/controller.py index 8afef1bf..9096dcd8 100644 --- a/controller.py +++ b/controller.py @@ -214,7 +214,7 @@ def sendChatMessage(message): if config.ENABLE_AUTO_CLEAR_MESSAGE_BOX is True: view.clearMessageBox() -def messageBoxPressKeyEnter(e): +def messageBoxPressKeyEnter(): model.oscStopSendTyping() message = view.getTextFromMessageBox() sendChatMessage(message) @@ -403,6 +403,11 @@ def callbackSetTextboxUiScaling(value): config.TEXTBOX_UI_SCALING = int(value) view.setMainWindowTextboxUiSize(config.TEXTBOX_UI_SCALING/100) +def callbackSetMessageBoxRatio(value): + print("callbackSetMessageBoxRatio", int(value)) + config.MESSAGE_BOX_RATIO = int(value) + view.setMainWindowMessageBoxRatio(config.MESSAGE_BOX_RATIO) + def callbackSetFontFamily(value): print("callbackSetFontFamily", value) config.FONT_FAMILY = value @@ -836,6 +841,7 @@ def createMainWindow(): "callback_set_appearance": callbackSetAppearance, "callback_set_ui_scaling": callbackSetUiScaling, "callback_set_textbox_ui_scaling": callbackSetTextboxUiScaling, + "callback_set_message_box_ratio": callbackSetMessageBoxRatio, "callback_set_font_family": callbackSetFontFamily, "callback_set_ui_language": callbackSetUiLanguage, diff --git a/locales/en.yml b/locales/en.yml index f805540c..dbfc39c6 100644 --- a/locales/en.yml +++ b/locales/en.yml @@ -103,6 +103,10 @@ config_window: label: Text Box Font Size desc: You can adjust the font size used in the logs relative to the UI size. + message_box_ratio: + label: Message Box Size + desc: "You can change the size of the input message box. It is in ratio to the text box.\n*No exact calculations." + font_family: label: Font Family diff --git a/locales/ja.yml b/locales/ja.yml index 5cb6ef99..cca4e254 100644 --- a/locales/ja.yml +++ b/locales/ja.yml @@ -100,6 +100,10 @@ config_window: label: テキストボックス フォントサイズ desc: ログに表示されるフォントのサイズを、UIサイズを基準にして倍率を変えられます。 + message_box_ratio: + label: メッセージ入力欄のサイズ + desc: "メッセージ入力欄のサイズを変更できます。テキストボックスとの比率となっています。\n※厳密な計算はしていません。" + font_family: label: 使用フォント diff --git a/view.py b/view.py index ed187e5a..46973a39 100644 --- a/view.py +++ b/view.py @@ -220,6 +220,14 @@ class View(): CALLBACK_BUTTON_PRESS_TEXTBOX_UI_SCALING=self._closeTheCoverOfMainWindow, CALLBACK_BUTTON_RELEASE_TEXTBOX_UI_SCALING=self._openTheCoverOfMainWindow, + VAR_LABEL_MESSAGE_BOX_RATIO=StringVar(value=i18n.t("config_window.message_box_ratio.label")), + VAR_DESC_MESSAGE_BOX_RATIO=StringVar(value=i18n.t("config_window.message_box_ratio.desc")), + SLIDER_RANGE_MESSAGE_BOX_RATIO=(1, 99), + CALLBACK_SET_MESSAGE_BOX_RATIO=None, + VAR_MESSAGE_BOX_RATIO=IntVar(value=config.MESSAGE_BOX_RATIO), + CALLBACK_BUTTON_PRESS_MESSAGE_BOX_RATIO=self._closeTheCoverOfMainWindow, + CALLBACK_BUTTON_RELEASE_MESSAGE_BOX_RATIO=self._openTheCoverOfMainWindow, + VAR_LABEL_FONT_FAMILY=StringVar(value=i18n.t("config_window.font_family.label")), VAR_DESC_FONT_FAMILY=None, LIST_FONT_FAMILY=self.getAvailableFonts(), @@ -480,8 +488,12 @@ class View(): self.view_variable.CALLBACK_SELECTED_LANGUAGE_PRESET_TAB = main_window_registers.get("callback_selected_language_preset_tab", None) + def adjustedMessageBoxReturnFunction(_e): + main_window_registers.get("message_box_bind_Return")() + return "break" + entry_message_box = getattr(vrct_gui, "entry_message_box") - entry_message_box.bind("", main_window_registers.get("message_box_bind_Return")) + entry_message_box.bind("", adjustedMessageBoxReturnFunction) entry_message_box.bind("", main_window_registers.get("message_box_bind_Any_KeyPress")) @@ -512,6 +524,7 @@ class View(): self.view_variable.CALLBACK_SET_APPEARANCE = config_window_registers.get("callback_set_appearance", None) self.view_variable.CALLBACK_SET_UI_SCALING = config_window_registers.get("callback_set_ui_scaling", None) self.view_variable.CALLBACK_SET_TEXTBOX_UI_SCALING = config_window_registers.get("callback_set_textbox_ui_scaling", None) + self.view_variable.CALLBACK_SET_MESSAGE_BOX_RATIO = config_window_registers.get("callback_set_message_box_ratio", None) self.view_variable.CALLBACK_SET_FONT_FAMILY = config_window_registers.get("callback_set_font_family", None) self.view_variable.CALLBACK_SET_UI_LANGUAGE = config_window_registers.get("callback_set_ui_language", None) @@ -571,6 +584,7 @@ class View(): self.enableConfigWindowCompactMode() vrct_gui.config_window.setting_box_compact_mode_switch_box.select() + self.setMainWindowMessageBoxRatio(config.MESSAGE_BOX_RATIO) if config.CHOICE_MIC_HOST == "NoHost": self.view_variable.VAR_MIC_HOST.set("No Mic Host Detected") @@ -774,7 +788,7 @@ class View(): # Common @staticmethod def _clearEntryBox(entry_widget): - entry_widget.delete(0, CTK_END) + entry_widget.delete("1.0", "end-1c") def clearErrorMessage(self): vrct_gui._clearErrorMessage() @@ -1063,6 +1077,19 @@ class View(): def setMainWindowTextboxUiSize(custom_font_size_scale:float): vrct_gui.print_to_textbox.setTagsSettings(custom_font_size_scale=custom_font_size_scale) + @staticmethod + def setMainWindowMessageBoxRatio(message_box_ratio:int): + if message_box_ratio <= 0 or message_box_ratio > 99: + raise ValueError("Input must be between 1 and 99 (inclusive)") + + vrct_gui.main_bg_container.grid_rowconfigure(tuple(range(1, 101)), weight=1) + textbox_ratio = int(100 - message_box_ratio) + message_box_row = int(textbox_ratio + 1) + message_box_rowwpan = int(100 - textbox_ratio) + # print(textbox_ratio, message_box_row, message_box_rowwpan) + vrct_gui.main_textbox_container.grid(row=1, rowspan=textbox_ratio, column=0, sticky="nsew") + vrct_gui.main_entry_message_container.grid(row=message_box_row, rowspan=message_box_rowwpan, column=0, sticky="nsew") + # Function def _adjustUiSizeAndRestart(self): current_percentage = int(config.UI_SCALING.replace("%","")) @@ -1394,7 +1421,7 @@ class View(): # Message Box @staticmethod def getTextFromMessageBox(): - return vrct_gui.entry_message_box.get() + return vrct_gui.entry_message_box.get('1.0', CTK_END) def clearMessageBox(self): self._clearEntryBox(vrct_gui.entry_message_box) diff --git a/vrct_gui/_changeMainWindowWidgetsStatus.py b/vrct_gui/_changeMainWindowWidgetsStatus.py index 53c29f2a..75668102 100644 --- a/vrct_gui/_changeMainWindowWidgetsStatus.py +++ b/vrct_gui/_changeMainWindowWidgetsStatus.py @@ -141,9 +141,11 @@ def _changeMainWindowWidgetsStatus(vrct_gui, settings, view_variable, status, ta case "entry_message_box": if status == "disabled": - vrct_gui.entry_message_box.configure(state="disabled", placeholder_text_color=settings.ctm.TEXTBOX_ENTRY_PLACEHOLDER_DISABLED_COLOR, text_color=settings.ctm.TEXTBOX_ENTRY_TEXT_DISABLED_COLOR) + pass + vrct_gui.entry_message_box.configure(state="disabled", text_color=settings.ctm.TEXTBOX_ENTRY_TEXT_DISABLED_COLOR) elif status == "normal": - vrct_gui.entry_message_box.configure(state="normal", placeholder_text_color=settings.ctm.TEXTBOX_ENTRY_PLACEHOLDER_COLOR, text_color=settings.ctm.TEXTBOX_ENTRY_TEXT_COLOR) + pass + vrct_gui.entry_message_box.configure(state="normal", text_color=settings.ctm.TEXTBOX_ENTRY_TEXT_COLOR) case _: diff --git a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py index dd5f68ab..a228e5a1 100644 --- a/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py +++ b/vrct_gui/config_window/widgets/createSideMenuAndSettingsBoxContainers/setting_box_containers/setting_box_appearance/createSettingBox_Appearance.py @@ -21,6 +21,9 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings, vi def slider_text_box_ui_scaling_callback(value): callFunctionIfCallable(view_variable.CALLBACK_SET_TEXTBOX_UI_SCALING, value) + def slider_message_box_ratio_callback(value): + callFunctionIfCallable(view_variable.CALLBACK_SET_MESSAGE_BOX_RATIO, value) + def optionmenu_font_family_callback(value): callFunctionIfCallable(view_variable.CALLBACK_SET_FONT_FAMILY, value) @@ -82,6 +85,19 @@ def createSettingBox_Appearance(setting_box_wrapper, config_window, settings, vi config_window.sb__textbox_uis_scaling.grid(row=row) row+=1 + config_window.sb__message_box_ratio = createSettingBoxSlider( + for_var_label_text=view_variable.VAR_LABEL_MESSAGE_BOX_RATIO, + for_var_desc_text=view_variable.VAR_DESC_MESSAGE_BOX_RATIO, + slider_attr_name="sb__slider_message_box_ratio", + slider_range=view_variable.SLIDER_RANGE_MESSAGE_BOX_RATIO, + command=lambda value: slider_message_box_ratio_callback(value), + variable=view_variable.VAR_MESSAGE_BOX_RATIO, + slider_bind__ButtonPress=view_variable.CALLBACK_BUTTON_PRESS_MESSAGE_BOX_RATIO, + slider_bind__ButtonRelease=view_variable.CALLBACK_BUTTON_RELEASE_MESSAGE_BOX_RATIO, + sliderTooltipFormatter=view_variable.CALLBACK_SLIDER_TOOLTIP_PERCENTAGE_FORMATTER, + ) + config_window.sb__message_box_ratio.grid(row=row) + row+=1 config_window.sb__font_family = createSettingBoxDropdownMenu( for_var_label_text=view_variable.VAR_LABEL_FONT_FAMILY, diff --git a/vrct_gui/main_window/widgets/create_entry_message_box.py b/vrct_gui/main_window/widgets/create_entry_message_box.py index e583234f..2be17e9c 100644 --- a/vrct_gui/main_window/widgets/create_entry_message_box.py +++ b/vrct_gui/main_window/widgets/create_entry_message_box.py @@ -1,23 +1,22 @@ -from customtkinter import CTkFont, CTkFrame, CTkEntry +from customtkinter import CTkFont, CTkFrame, CTkTextbox def createEntryMessageBox(settings, main_window): main_window.main_entry_message_container = CTkFrame(main_window.main_bg_container, corner_radius=0, fg_color=settings.ctm.MAIN_BG_COLOR, width=0, height=0) - main_window.main_entry_message_container.grid(row=2, column=0, sticky="ew") + main_window.main_entry_message_container.grid(row=2, column=0, sticky="nsew") main_window.main_entry_message_container.grid_columnconfigure(0, weight=1) - main_window.entry_message_box = CTkEntry( + main_window.main_entry_message_container.grid_rowconfigure(0, weight=1) + main_window.entry_message_box = CTkTextbox( main_window.main_entry_message_container, border_color=settings.ctm.TEXTBOX_ENTRY_BORDER_COLOR, fg_color=settings.ctm.TEXTBOX_ENTRY_BG_COLOR, text_color=settings.ctm.TEXTBOX_ENTRY_TEXT_COLOR, - placeholder_text="Enter your message...", - placeholder_text_color=settings.ctm.TEXTBOX_ENTRY_PLACEHOLDER_COLOR, - height=settings.uism.TEXTBOX_ENTRY_HEIGHT, + border_width=settings.uism.TEXTBOX_ENTRY_BORDER_SIZE, + height=0, font=CTkFont(family=settings.FONT_FAMILY, size=settings.uism.TEXTBOX_ENTRY_FONT_SIZE, weight="normal"), ) main_window.entry_message_box.grid(row=0, column=0, padx=settings.uism.TEXTBOX_ENTRY_PADX, pady=settings.uism.TEXTBOX_ENTRY_PADY, sticky="nsew") - main_window.entry_message_box._entry.grid(padx=settings.uism.TEXTBOX_ENTRY_IPADX, pady=settings.uism.TEXTBOX_ENTRY_IPADY) def messageBoxAnyKeyPress(e): diff --git a/vrct_gui/main_window/widgets/create_textbox.py b/vrct_gui/main_window/widgets/create_textbox.py index 99e977f4..41203049 100644 --- a/vrct_gui/main_window/widgets/create_textbox.py +++ b/vrct_gui/main_window/widgets/create_textbox.py @@ -142,6 +142,7 @@ def createTextbox(settings, main_window, view_variable): fg_color=settings.ctm.TEXTBOX_BG_COLOR, text_color="lime", # Textbox's text_color is set when printing. so this is for prevent from non-setting text_color like the gloves used in food factories are blue. wrap="word", + height=0, )) textbox_widget = getattr(main_window, textbox_setting["textbox_attr_name"]) textbox_widget.grid(row=0, column=0, padx=settings.uism.TEXTBOX_PADX, pady=0, sticky="nsew") diff --git a/vrct_gui/ui_managers/UiScalingManager.py b/vrct_gui/ui_managers/UiScalingManager.py index 08782d05..7c79e02e 100644 --- a/vrct_gui/ui_managers/UiScalingManager.py +++ b/vrct_gui/ui_managers/UiScalingManager.py @@ -50,11 +50,10 @@ class UiScalingManager(): self.main.TEXTBOX_FONT_SIZE__MAIN_TEXT_FONT = self._calculateUiSize(16) self.main.TEXTBOX_ENTRY_FONT_SIZE = self._calculateUiSize(16) + self.main.TEXTBOX_ENTRY_BORDER_SIZE = self._calculateUiSize(2, is_allowed_odd=True) self.main.TEXTBOX_ENTRY_HEIGHT = self._calculateUiSize(40) self.main.TEXTBOX_ENTRY_PADX = self.main.TEXTBOX_PADX self.main.TEXTBOX_ENTRY_PADY = self._calculateUiSize(10) - self.main.TEXTBOX_ENTRY_IPADX = self._calculateUiSize(14) - self.main.TEXTBOX_ENTRY_IPADY = (self._calculateUiSize(2, True), self._calculateUiSize(3, True)) # Sidebar From 1d380264e48927fef49f9c87dbe71eee927ccbe3 Mon Sep 17 00:00:00 2001 From: Sakamoto Shiina <68018796+ShiinaSakamoto@users.noreply.github.com> Date: Fri, 29 Dec 2023 02:20:58 +0900 Subject: [PATCH 2/2] =?UTF-8?q?[bugfix/chore]=20Main=20Window:=20Message?= =?UTF-8?q?=20Box.=20=E5=85=A5=E5=8A=9B=E3=83=9C=E3=83=83=E3=82=AF?= =?UTF-8?q?=E3=82=B9=E3=81=8C=E7=A9=BA=E3=81=AE=E7=8A=B6=E6=85=8B=E3=81=A7?= =?UTF-8?q?=E3=82=A8=E3=83=B3=E3=82=BF=E3=83=BC=E3=82=AD=E3=83=BC=E3=82=92?= =?UTF-8?q?=E6=8A=BC=E3=81=97=E3=81=9F=E6=99=82=E3=81=AB=E9=80=81=E4=BF=A1?= =?UTF-8?q?=E3=81=95=E3=82=8C=E3=81=A6=E3=81=97=E3=81=BE=E3=81=86=E3=81=AE?= =?UTF-8?q?=E3=82=92=E4=BF=AE=E6=AD=A3=E3=80=82=E2=80=BBCTkEntry=E3=81=8B?= =?UTF-8?q?=E3=82=89CTkTextbox=E3=81=AB=E5=A4=89=E6=9B=B4=E3=81=97?= =?UTF-8?q?=E3=81=9F=E3=81=93=E3=81=A8=E3=81=AB=E3=82=88=E3=82=8B=E5=BD=B1?= =?UTF-8?q?=E9=9F=BF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- view.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/view.py b/view.py index 46973a39..b105ffd6 100644 --- a/view.py +++ b/view.py @@ -490,7 +490,7 @@ class View(): def adjustedMessageBoxReturnFunction(_e): main_window_registers.get("message_box_bind_Return")() - return "break" + return "break" # For deleting the next line that will be inserted when the Enter key is pressed. entry_message_box = getattr(vrct_gui, "entry_message_box") entry_message_box.bind("", adjustedMessageBoxReturnFunction) @@ -788,7 +788,7 @@ class View(): # Common @staticmethod def _clearEntryBox(entry_widget): - entry_widget.delete("1.0", "end-1c") + entry_widget.delete("1.0", "end") def clearErrorMessage(self): vrct_gui._clearErrorMessage() @@ -1421,7 +1421,7 @@ class View(): # Message Box @staticmethod def getTextFromMessageBox(): - return vrct_gui.entry_message_box.get('1.0', CTK_END) + return vrct_gui.entry_message_box.get('1.0', "end-1c") def clearMessageBox(self): self._clearEntryBox(vrct_gui.entry_message_box)