Answers for "how to set the tab size in tkinter"

0

how to set the tab size in tkinter

from tkinter import *
import tkinter.font as tkfont

root = Tk()

text = Text(root)
text.pack()

font = tkfont.Font(font=text['font'])
tab = font.measure('    ')

text.config(tabs=tab)

root.mainloop()
Posted by: Guest on August-01-2020

Python Answers by Framework

Browse Popular Code Answers by Language