CustomTkinter icon indicating copy to clipboard operation
CustomTkinter copied to clipboard

Adding Scrollbar to the Textbox

Open PavtheDog opened this issue 3 years ago • 0 comments

I been playing with CustomTkinter and notice that textbox doesn't have the capabilities to use the scrollbar. I added the following to ctk_textbox:

def set_scrollbar(self, scrollbar): self.textbox['yscrollcommand'] = scrollbar.set

Example: self.textbox_1 = customtkinter.CTkTextbox(master=self.frame_right, height=200) self.textbox_1.grid(row=7, column=0, columnspan=2, pady=20, padx=20, sticky="we") self.scrollbar_1 = customtkinter.CTkScrollbar(master=self.frame_right, command=self.textbox_1.yview) self.scrollbar_1.grid(row=7, column=1, columnspan=2, pady=20, padx=0, sticky='ns') self.textbox_1.set_scrollbar(self.scrollbar_1)

PavtheDog avatar Sep 08 '22 20:09 PavtheDog