我正在尝试创建一个按钮,按下该按钮将调用整个帧。
这是按钮:
self.inboxbtn = Button(self.root, text="INBOX", font=("Fixedsys", 20, "bold"), bg="#06E63B", fg="#A3FC7C", command=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)
这是错误:
Tkinter回调中的异常
追溯(最近一次通话):
调用中的文件“ C:\ Python27 \ lib \ lib-tk \ Tkinter.py”,行1547 返回self.func(* args)
收件箱中的文件“ C:\ Users \ Shirgene \ Desktop \ PYTHON \ mainpage.py”,第138行
self.chck = Checkbutton(self.inframe,text = curr,font =(“ Consolas”,10),command = partial(self.inboxbtn,intitle))
TypeError:第一个参数必须是可调用的