So i'm new using tkinter and im reading a book to learn, but i'm having trouble with this example using the pack()
function. It is supposed to look like the buttons are centered but for me it doesn't work, it shows like if there was some other blank frame on the top of my actual frame.
Here's how it looks, and here is how is supposed to look.
Any help is apreciated. Thanks.
Here's the code:
from tkinter import *
class App:
def __init__(self, fm):
Button(fm, text='Left').pack(side=LEFT, expand = YES)
Button(fm, text='Center').pack(side=LEFT, expand = YES)
Button(fm, text='Right').pack(side=LEFT, expand = YES)
root = Tk()
fm = Frame(root, width=300, height=200).pack(expand=True, fill=BOTH)
root.option_add('*font', ('verdana', 12, 'bold'))
root.title("Pack - Example 1")
display = App(fm)
root.mainloop()
Book: Python and tkinter programming by John E. Grayson