在框架中看不到按钮 我做了一些像矩阵3x3
3框架顶部、中部和底部
在earh frame descripve up中,我有3帧左右 在最后一帧中,我有一个按钮 但是没有看到按钮
from tkinter import *
root = Tk()
f_top = Frame(root)
f_mid = Frame(root)
f_down = Frame(root)
frame1 = Frame(f_top, width=50, height=50, background="bisque").pack(fill=None, expand=False,side = 'left')
frame2 = Frame(f_top, width=50, height=50, background="bisque").pack(fill=None, expand=False,side = 'left')
frame3 = Frame(f_top, width=50, height=50, background="bisque").pack(fill=None, expand=False,side = 'left')
frame4 = Frame(f_mid, width=50, height=50, background="bisque").pack(fill=None, expand=False,side = 'left')
frame5 = Frame(f_mid, width=50, height=50, background="bisque").pack(fill=None, expand=False,side = 'left')
frame6 = Frame(f_mid, width=50, height=50, background="bisque").pack(fill=None, expand=False,side = 'left')
frame7 = Frame(f_down, width=50, height=50, background="bisque").pack(fill=None, expand=False,side = 'left')
frame8 = Frame(f_down, width=50, height=50, background="bisque").pack(fill=None, expand=False,side = 'left')
frame9 = Frame(f_down, width=50, height=50, background="bisque").pack(fill=None, expand=False,side = 'left')
f_top.pack()
f_mid.pack()
f_down.pack()
Button(frame2, text = 'top', command=a1)
Button(frame4,height=40, width=40, text = 'left', command=a3)
Button(frame6,height=40, width=40, text = 'right', command=a4)
Button(frame8,height=40, width=40, text = 'bottom', command=a2)
Button(frame5,height=40, width=40, text = 'start', command=a5)
Button(frame1,height=40, width=40, text = 'nostart', command=a6)
root.mainloop()
相关问题 更多 >
编程相关推荐