I am trying to create a Tkinter Text widget with a Scrollbar . This works fine, but I want the Scrollbar have a width of 12 pixels instead of the default value of 16 pixels. The online documentation says that width is really an option you can set. So what am I doing wrong? Below is the code I tried to use.
from tkinter import * root = Tk() textBox = Text(root, bd=0, font=('Courier New', 8), width=100, height=25, wrap=NONE) textVerticalScroll = Scrollbar(root, width=12) textBox.configure(yscrollcommand=textVerticalScroll.set) textBox.pack(side=LEFT, fill=BOTH, expand=True) textVerticalScroll.pack(side=RIGHT, fill=Y)
source share