jjzjj

columnconfigure

全部标签

python - Tk 网格无法正确调整大小

我正在尝试使用Python中的Tkinter编写一个简单的用户界面,但我无法让网格中的小部件调整大小。每当我调整主窗口大小时,条目和按钮小部件根本不会调整。这是我的代码:classApplication(Frame):def__init__(self,master=None):Frame.__init__(self,master,padding=(3,3,12,12))self.grid(sticky=N+W+E+S)self.createWidgets()defcreateWidgets(self):self.dataFileName=StringVar()self.fileEntr

python - 'weight' 在 tkinter 中有什么作用?

我一直在搜索不同的网站,试图找出重量在tkinter中的作用。我是从TkDocs那里得到的:Everycolumnandrowhasa"weight"gridoptionassociatedwithit,whichtellsithowmuchitshouldgrowifthereisextraroominthemastertofill.Bydefault,theweightofeachcolumnorrowis0,meaningdon'texpandtofillspace.有人可以帮我把它放在一些背景下,因为我正在努力理解它的作用。我已经尝试过以下代码,当我更改值时,它似乎只是在页面上

python - 'weight' 在 tkinter 中有什么作用?

我一直在搜索不同的网站,试图找出重量在tkinter中的作用。我是从TkDocs那里得到的:Everycolumnandrowhasa"weight"gridoptionassociatedwithit,whichtellsithowmuchitshouldgrowifthereisextraroominthemastertofill.Bydefault,theweightofeachcolumnorrowis0,meaningdon'texpandtofillspace.有人可以帮我把它放在一些背景下,因为我正在努力理解它的作用。我已经尝试过以下代码,当我更改值时,它似乎只是在页面上