Auto Scroll for Textbox #2258
jwernerfink
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
so i use a textbox for a simple log field. but when i output a lot of stuff to it and append some text to the end it does not automaticlly scroll to the bottom. Any ideas?
...
self.api_frame_logging_box = customtkinter.CTkTextbox(self.api_frame, width=250, fg_color="#dbdbdb")
self.api_frame_logging_box.configure(state='disabled')
self.api_frame_logging_box.grid(row=2, column=0, pady=0, padx=10, sticky="nsew")
...
def log_api_message(self, message):
timestamp = datetime.now().strftime("%Y-%m-%d %H:%M:%S")
logging_entry = self.api_frame_logging_box
logging_entry.configure(state='normal')
formatted_message = f"{timestamp}: {message}\n"
logging_entry.insert(customtkinter.END, formatted_message)
logging_entry.update_idletasks()
logging_entry.configure(state='disabled')
...
Beta Was this translation helpful? Give feedback.
All reactions