From 7901edba302c313489b3f0a9e550529950a09d54 Mon Sep 17 00:00:00 2001 From: TomSchimansky Date: Sat, 21 Jan 2023 22:37:40 +0100 Subject: [PATCH] remove unnecessary check_scollbar call in textbox #1020 --- customtkinter/windows/widgets/ctk_textbox.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/customtkinter/windows/widgets/ctk_textbox.py b/customtkinter/windows/widgets/ctk_textbox.py index 1fa1331..eeee9ef 100644 --- a/customtkinter/windows/widgets/ctk_textbox.py +++ b/customtkinter/windows/widgets/ctk_textbox.py @@ -119,7 +119,7 @@ class CTkTextbox(CTkBaseClass): self._create_grid_for_text_and_scrollbars(re_grid_textbox=True, re_grid_x_scrollbar=True, re_grid_y_scrollbar=True) - self.after(50, self._check_if_scrollbars_needed) + self.after(50, self._check_if_scrollbars_needed, None, True) self._draw() def _create_grid_for_text_and_scrollbars(self, re_grid_textbox=False, re_grid_x_scrollbar=False, re_grid_y_scrollbar=False): @@ -151,7 +151,7 @@ class CTkTextbox(CTkBaseClass): else: self._y_scrollbar.grid_forget() - def _check_if_scrollbars_needed(self, event=None, continue_loop: bool = True): + def _check_if_scrollbars_needed(self, event=None, continue_loop: bool = False): """ Method hides or places the scrollbars if they are needed on key release event of tkinter.text widget """ if self._scrollbars_activated: @@ -349,7 +349,6 @@ class CTkTextbox(CTkBaseClass): return self._textbox.focus_force() def insert(self, index, text, tags=None): - self._check_if_scrollbars_needed() return self._textbox.insert(index, text, tags) def get(self, index1, index2=None):