Python Forum

Full Version: not resize a frame
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
hi,

I define the size of a frame but when I add 4 buttons, it's automatically resized.

someone knows how I can fix it ?

thanks for your help
No one can help with no code sample showing the issue you are having.
it s there.

could you explain me why my frame is resize when my buttons are created?

if I run it without button, I obtain the right size.

class playmats(object):
    
    def __init__(self):
        self.contrée_window = Tk()
        self.contrée_window.geometry("800x800")
        self.contrée_playmats = ""



class contrée_playmats(playmats):
    
    def __init__(self):
        super().__init__()


    def build_playmats(self, list_players = ["nico", "franck", "steph", "man"]):
        self.contrée_playmats = Frame(width=800, height=800, bg="green")
        self.contrée_playmats.grid()
        
        self.entry_button()

        self.contrée_window.mainloop()
        self.contrée_window.destroy()


    def entry_button(self):
        list_place = ((2, 7), (7, 13), (13, 7), (7, 2))
        for seat in range(4):
            entry_button = Button(self.contrée_playmats, text="Take a seat")
            entry_button.grid(row=list_place[seat][0], column=list_place[seat][1], columnspan = 1, rowspan = 1)