python tkinter怎么让多个按钮在Frame中排成一行

from tkinter import root = Tk()a = LabelFrame(root, height=200, width=300, text='选择游戏')a.pack(side='top', fill='both', expand=True)btn1 = Button(a, text='开始游戏')btn1.grid(row=0, column=0)btn2 = Button(a, text='在玩一次')btn2.grid(row=0, column=1)bt...
python tkinter怎么让多个按钮在Frame中排成一行
from tkinter import *
root = Tk()
a = LabelFrame(root, height=200, width=300, text='选择游戏')
a.pack(side='top', fill='both', expand=True)
btn1 = Button(a, text='开始游戏')
btn1.grid(row=0, column=0)
btn2 = Button(a, text='在玩一次')
btn2.grid(row=0, column=1)
btn3 = Button(a, text='结束游戏')
btn3.grid(row=0, column=2)
root.mainloop()2019-01-07
难道它没有排成一行?2018-01-07
mengvlog 阅读 11 次 更新于 2025-07-19 12:18:57 我来答关注问题0
檬味博客在线解答立即免费咨询

Python相关话题

Copyright © 2023 WWW.MENGVLOG.COM - 檬味博客
返回顶部