这是我的代码,我真正想做的是在框架中间设置 URL 标签和旁边的输入文本,并在 URL 和输入文本字段下方添加 3 个按钮。
import tkinter as tk
from tkinter import *
root = tk.Tk()
root.geometry("520x400")
frame1 = tk.LabelFrame(root, text="my_first_window", width=400, height=200, bd=5)
Label(root, text="URL:").grid(row=0, column=1 ,sticky=W)
e1 = Entry(root)
e1.grid(row=0, column=2)
frame1.grid(row=0, column=0, columnspan=7, padx=8)
Button(root, text='BACK', command=lambda:print('BACK')).grid(row=8, column=1, sticky=W, pady=4)
Button(root, text='NEXT', command=lambda:print('NEXT')).grid(row=8, column=2, sticky=W, pady=4)
Button(root, text='CANCLE', command=lambda:print('CANCLE')).grid(row=8, column=3, sticky=W, pady=4)
mainloop()