对于所提到的问题,我不能找到可以固定GUI窗口和所有的标签,按钮等位置上的任意代码..如何让python3.3 gui窗口固定大小?
import tkinter
import tkinter.messagebox
class Menu:
def __init__(self):
self.main = tkinter.Tk(height = 200, width = 400)
self.position = tkinter.Label(self.main, text = '123',\
bg = 'Purple',\
height = 2, width = 8)
self.position.place(height=50, width= 100)
self.position.pack()
tkinter.mainloop()
gui = Menu()
对于这一点,我只能做标签的大小,而不是主窗口的位置和大小。 它给这个错误
Traceback (most recent call last):
File "C:\Python33\Saves\Label position.py", line 18, in <module>
gui = Menu()
File "C:\Python33\Saves\Label position.py", line 7, in __init__
self.main = tkinter.Tk(height = 200, width = 400)
TypeError: __init__() got an unexpected keyword argument 'height'
你是否想确定尺寸?绝大多数图形用户界面在被允许成为自然尺寸时效果更好。或者,你只是在试验吗? –