Change Font Size Without Messing With Tkinter Button Size
Answer : Typically, when you give a button a width, that width is measured in characters (ie: width=1 means the width of one average sized character). However, if the button has an image then the width specifies a size in pixels. A button can contain both an image and text, so one strategy is to put a 1x1 pixel as an image so that you can specify the button size in pixels. When you do that and you change the font size, the button will not grow since it was given an absolute size. Here is an example that illustrates the technique. Run the code, then click on "bigger" or "smaller" to see that the text changes size but the button does not. import Tkinter as tk import tkFont def bigger(): size = font.cget("size") font.configure(size=size+2) def smaller(): size = font.cget("size") size = max(2, size-2) font.configure(size=size) root = tk.Tk() font = tkFont.Font(family="Helvetica", size=12) toolbar = tk.Fra...