Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How can i change the font on ttk.Entry

Is there any way to change the ttk.Entry font I've tried with the ttk.style but TypeError occurs.

Like:

my_style = ttk.Style('TEntry' , font = ('Arial' , 10 , 'bold'))
my_entry = ttk.Entry(master)
my_entry.pack()
like image 731
L0aD1nG Avatar asked Dec 23 '13 13:12

L0aD1nG


1 Answers

Specify font in ttk.Entry constructor.

For example:

from Tkinter import * # from tkinter import *    IN Python 3.x
import ttk

master = Tk()
my_entry = ttk.Entry(master, font=('Arial', 10, 'bold')) # <-----
my_entry.pack()

mainloop()
like image 143
falsetru Avatar answered Sep 27 '22 18:09

falsetru