import Tkinter as tk
from Tkinter import Frame
class App(Frame):
def __init__(self, pixwidth, pixheight):
self.__initialize_master(pixwidth, pixheight)
Frame.__init__(self, self.master)
self.pack()
self.__initialize_top()
def __initialize_master(self, width, height):
self.master = tk.Tk()
self.master.geometry("%dx%d+100+100" % (width, height))
def __initialize_top(self):
self.top_frames = [tk.LabelFrame(self, text="Status"),
tk.LabelFrame(self, text="Graph"),
tk.LabelFrame(self, text="Universal Controls")]
for i in xrange(3):
self.top_frames[i].grid(row=0,
column=2*i,
rowspan=4,
columnspan=2,
sticky='nswe')
def run(self):
self.master.mainloop()
if __name__=="__main__":
app = App(800, 600)
app.run()
我不确定我应该看到什么,但我希望至少能看到 LabelFrames 的标题之类的!但我看到的只是一个空白窗口。我不确定为什么我看不到东西,有人可以指出我做错了什么吗?