个人而言,我总是做第二件事,因为当您制作更长的应用程序时,它会容易得多。这是使用第二个示例:
from Tkinter import *
app = Tk() #app is a variable, so in the future, you can define Tk() as anything you want. Most people call it root
frame = Frame(app)
frame.pack()
bottomframe = Frame(app)
bottomframe.pack( side = BOTTOM )
redbutton = Button(frame, text="Red", fg="red")
redbutton.pack( side = LEFT)
greenbutton = Button(frame, text="Brown", fg="brown")
greenbutton.pack( side = LEFT )
bluebutton = Button(frame, text="Blue", fg="blue")
bluebutton.pack( side = LEFT )
blackbutton = Button(bottomframe, text="Black", fg="black")
blackbutton.pack( side = BOTTOM)
app.mainloop()
祝你好运。抱歉,我无法完全回答您的问题
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句