【问题标题】:TKinter columnconfigure resize option not workingTKinter columnconfigure 调整大小选项不起作用
【发布时间】:2020-07-23 16:41:42
【问题描述】:

这是我调整 tkinter 条目大小的代码,但它不起作用。有人可以帮我弄清楚吗?即使我使用 columnconfigure 和sticky,它也不会调整大小。我的代码在下面

self.ScriptEntry = tk.Entry(self,textvariable=self.FileText) 
self.ScriptEntry.grid(column=2,row=0, columnspan=2, sticky = W+E) 
self.ScriptEntry.columnconfigure(2, weight = 1)

【问题讨论】:

    标签: python user-interface tkinter grid tkinter-entry


    【解决方案1】:

    columnconfigurerowconfigure 必须在包含该条目的小部件上调用。在这种情况下,这将是self.columnconfigure(2, weight=1)

    【讨论】:

    • 我试过这个,但它仍然没有显示任何变化。还有什么我应该做的吗?
    • @NupurDave:如果您尝试过,您需要给我们一个正确的minimal reproducible example。否则,您的问题中没有足够的信息。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2015-10-22
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多