I hope my formatting is proper.
My code:
My code:
from tkinter import * from tkinter import font root = Tk() root.geometry('500x500') root.title('Tkinter Frame Test') myFont = font.Font(family = 'Helvetica', size = 20) frame1 = Frame(root, bg='green') frame1.pack(expand=True, fill=BOTH) frame2 = Frame(frame1, width = 20, height = 20) frame2.pack(expand = False) button1 = Button(frame2, text='Grrrrr', font = myFont) button1.pack() root.mainloop()Made this little tkinter test code, i make tiny programs for testing so i don't screw up my main program, and what i am trying to do is get a button where i can change the font size of the button text without changing the button size. I know width= and height= are specified in character width which is why the button size gets bigger when the font get bigger. My understanding is that to make this work, i need to put the button in its own frame as the frame is specified in pixels and i just have to set the button to expand=True and fill=BOTH. I just can't get it to work. am i wrong in my thinking? am i coding it wrong? I made frame1 the root frame, frame2 the button frame inside of frame1 to hold my button. no matter what i do, when i change font size, button size changes even if i try to "freeze" frame1 by expand=False.