【问题标题】:Tkinter Button Align with GridTkinter 按钮与网格对齐
【发布时间】:2020-03-11 16:45:51
【问题描述】:

我想将我的 tkinter 按钮向左对齐,但找不到任何帮助。

addButton = Button(root,
                   text="Add Expenses",
                   bg='red',
                   fg='white',
                   command = addButtonDef,
                   font=("Arial narrow",32))
addButton.grid(row=1, column=0)

关于如何对齐它的任何解决方案?只使用网格?

【问题讨论】:

标签: python python-3.x tkinter


【解决方案1】:

您是否尝试过将“W”表示为西的粘性。

addButton.grid(sticky="W", row=1, column=0)

或者,您可以在 Button 小部件中尝试 anchor="w"。

addButton = Button(root,
                   anchor="w"...)

【讨论】:

    猜你喜欢
    • 2014-04-28
    • 1970-01-01
    • 2021-01-20
    • 2021-05-02
    • 1970-01-01
    • 2021-12-19
    • 2018-10-03
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多