我试着做一个按钮,当按下它的时候会调用整个画面
这是按钮:
self.inboxbtn = Button(self.root, text="INBOX", font=("Fixedsys", 20, "bold"), bg="#06E63B", fg="#A3FC7C", command=self.inboxing)
这是函数“self.inboxing”
def inboxing(self):
self.inframe.place_forget()
self.outframe.place_forget()
self.comframe.place_forget()
self.mesframe.place_forget()
self.inhead = Checkbutton(self.inframe, text="| FROM | SUBJECT |", font=("Fixedsys", 20, "bold"), width = 58, height = 2)
self.inhead.pack()
self.incounter = 0
for curr in os.listdir(self.inboxpath):
inpath = os.path.join("server/users/"+self.loguser+"/inbox/"+curr)
f = open(inpath, "r")
intitle = f.read()
print inpath
f.close()
self.incounter += 1
self.chck = Checkbutton(self.inframe, text=curr, font=("Consolas", 10), command=partial(self.inboxbtn, intitle))
self.chck.pack()
self.inframe.place(x = self.xbox, y = self.ybox, width = self.wbox, height = self.hbox)
这是错误:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\lib\lib-tk\Tkinter.py", line 1547, in call return self.func(*args)
File "C:\Users\Shirgene\Desktop\PYTHON\mainpage.py", line 138, in inboxing
self.chck = Checkbutton(self.inframe, text=curr, font=("Consolas", 10), command=partial(self.inboxbtn, intitle))
TypeError: the first argument must be callable
目前没有回答
相关问题 更多 >
编程相关推荐