简体   繁体   English

如何使用tkinter放置按钮或文本框或标签?

[英]How do I position buttons or text boxes or labels using tkinter?

I am trying to make a simple GUI program with python 3 using tkinter . 我正在尝试使用tkinter用python 3创建一个简单的GUI程序。 I need help moving labels, buttons, or entry boxes to different positions on the GUI. 我需要帮助将标签,按钮或输入框移动到GUI上的不同位置。

lbl_title = tkinter.Label(root, text="Welcome to the Guessing Game!", bg="white") 
lbl_title.pack()

Try grid 尝试网格

root = Tk()

l1 = Label(root, text="peace")
l1.grid(row=0, column=1)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 如何在 Tkinter 中定位按钮? - How do I position buttons in Tkinter? 如何在按钮前使用 tkinter-python 添加文本框,当我单击它们时,结果应显示在添加的文本框中 - How can I add text boxes using tkinter-python in front of the buttons that when I click them, the results should be displayed on the added text boxes 如何使用Tkinter定位小部件(条目,标签) - How to position widgets using tkinter (entries,labels) 如何在 tkinter 中循环创建按钮、文本框和标签 - How to create buttons, text boxes and label in loop in tkinter 如何使Python Tkinter文本自动调整按钮和标签大小? - How do you Make Python Tkinter Text Automatically Resize in Buttons and Labels? 如何根据使用 tkinter 和 python 的 quixo 游戏在按钮网格上的每个按钮上添加文本 - How Do I add text on every button on a grid of buttons depending on a game of quixo using tkinter and python 如何更改列表中 Tkinter 按钮的文本 - How do I change the text of Tkinter Buttons in a List 如何使用Python Tkinter修复与按钮文本无关的大小? - How with Python Tkinter do I fix the size irrelevant of text of buttons? 使用 Tkinter 从文本文件创建按钮/标签 - Using Tkinter to create buttons/labels from text file 如何在Tkinter中获取文本结束位置的行和列? - How do I get the line and column of the end position of text in Tkinter?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM