In this video we’ll look at the Scrolled Text Widget for TTKBootstrap!
Yes, you read that right! There’s a built in Text Widget that comes with it’s own scrollbar in TTKBootstrap!
No more needing to code a scrollbar and add it to a text widget, just use the ScrolledText widget and it couldn’t be easier.
Python Code: scroll_text.py
(Github Code)
from tkinter import * import ttkbootstrap as tb from ttkbootstrap.scrolled import ScrolledText root = tb.Window(themename="superhero") #root = Tk() root.title("TTK Bootstrap! Scrolled Text Widget?!") root.iconbitmap('images/codemy.ico') root.iconbitmap(default='images/codemy.ico') root.geometry('700x350') # Text Widget my_text = ScrolledText(root, height=20, width=110, wrap=WORD, autohide=False, bootstyle="danger", hbar=True) my_text.pack(pady=15) root.mainloop()
Add comment