【发布时间】:2021-01-14 18:34:31
【问题描述】:
我已经看到了这个Python Tkinter - Set Entry grid width 100% 和这个columnspan in grid options dose't function(这更有用),但不知道如何让我的“重新绘制”按钮填充它所在行的宽度。无论我将小部件的列跨度设置为什么,它都不会改变按钮的宽度。该按钮与其他小部件位于一个框架中,并且该行上没有其他任何内容。
用于按钮的代码:
button_quit2 = tk.Button(root, text = "Replot", command = rangesReplot, relief = tk.GROOVE, padx =30, pady =20 )
button_quit2.grid(row = 10, column = 0, columnspan=2)
【问题讨论】:
-
试试
button_quit2.grid(row = 10, column = 0, columnspan=2,stikcy='nsew')? -
@CoolCloud 您能否将其发布为答案,我会接受。仅列跨度还不够吗?您的建议有效。
-
这让我在接受之前等待,我想还有 2 分钟。
标签: python button tkinter grid columnspan