Skip to content

Commit

Permalink
remove unnecessary check_scollbar call in textbox TomSchimansky#1020
Browse files Browse the repository at this point in the history
  • Loading branch information
TomSchimansky committed Jan 21, 2023
1 parent 3944707 commit 7901edb
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions customtkinter/windows/widgets/ctk_textbox.py
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ def __init__(self,

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):
Expand Down Expand Up @@ -151,7 +151,7 @@ def _create_grid_for_text_and_scrollbars(self, re_grid_textbox=False, re_grid_x_
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:
Expand Down Expand Up @@ -349,7 +349,6 @@ def focus_force(self):
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):
Expand Down

0 comments on commit 7901edb

Please sign in to comment.