Font issues Tkinter/Python 3.5

KP kai.peters at gmail.com
Fri Jan 29 17:04:57 EST 2016


import tkinter as tk
from tkinter import ttk
from tkinter import font
...
    def __init__(self):
        self.root = tk.Tk()
        self.root.title('Main Window')
        self.root.geometry('1000x800+200+200')
        self.root.minsize(width=1000, height=800)
        
        default_font = tkFont.nametofont("TkDefaultFont")
        default_font.configure(size=12)
        self.root.option_add("*Font", default_font)        
        ... 
        self.root.mainloop()
...

tells me that 'tkFont' is not defined. What am I missing?

As always, thanks for any pointers!



More information about the Python-list mailing list