How to set a tkinter window to a constant size

后端 未结 5 775
粉色の甜心
粉色の甜心 2020-12-13 05:01

I\'m programming a little game with tkinter and briefly, I\'m stuck.

I have a kind od starting menu, in which are two buttons and one label.

If I just create

5条回答
  •  北海茫月
    2020-12-13 05:37

    There are 2 solutions for your problem:

    1. Either you set a fixed size of the Tkinter window; mw.geometry('500x500')

    OR

    1. Make the Frame adjust to the size of the window automatically;back.place(x = 0, y = 0, relwidth = 1, relheight = 1)

    *The second option should be used in place of back.pack()

提交回复
热议问题