lundi 29 décembre 2014

Python 3 Tkinter: How do I set the width of a Tkinter Scrollbar Widget


Vote count:

0




I'm trying to create a Tkinter Text widget with a Scrollbar. This is working all fine, except I want the Scrollbar to have a width of 12 pixels, instead of the default value of 16 pixels. On the documentation online, it states that width is indeed a legitimate option you can set. So what am I doing wrong? Below is the code I have tried using.



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)


asked 36 secs ago







Python 3 Tkinter: How do I set the width of a Tkinter Scrollbar Widget

Aucun commentaire:

Enregistrer un commentaire