Python Forum
[Tkinter] not resize a frame
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[Tkinter] not resize a frame
#1
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
Reply
#2
No one can help with no code sample showing the issue you are having.
Reply
#3
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)
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [PyQt] Can't get MDIarea to resize automatically with Main Window JayCee 4 3,485 Aug-02-2021, 08:47 PM
Last Post: JayCee
  how to resize image in canvas tkinter samuelmv30 2 17,793 Feb-06-2021, 03:35 PM
Last Post: joe_momma
  [PyQt] dynamically resize custom widget fill remaining space ironcthulhu 1 11,342 Dec-31-2019, 09:45 PM
Last Post: Denni
  [PySimpleGUI] error trying to resize Text element skratt 3 8,061 Dec-10-2019, 06:05 PM
Last Post: FullOfHelp
  [Tkinter] Display Selected Image from Directory and Resize it EchoLi 0 4,242 Oct-02-2019, 06:54 PM
Last Post: EchoLi
  [Tkinter] Scrollbar, Frame and size of Frame Maksim 2 9,026 Sep-30-2019, 07:30 AM
Last Post: Maksim
  [Tkinter] create and insert a new frame on top of another frame atlass218 4 11,148 Apr-18-2019, 05:36 PM
Last Post: atlass218
  [PyQt] Resize button with window resize FesterJester 2 9,772 Dec-03-2018, 12:02 AM
Last Post: FesterJester
  [Tkinter] Frame size only works if frame is empty(Solved) Tuck12173 7 6,475 Jan-29-2018, 10:44 PM
Last Post: Larz60+

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020