1
类
的功能我Kivy玩耍,并有建立一些按钮有:Kivy传递变量在
for i in range(30):
self.user = str(i)
self.btn = Button(text=self.user, size_hint_y=None, height=40)
self.btn.bind(on_press=self.auth(self.user))
self.layout.add_widget(self.btn)
这些按钮调用验证:
def auth(mytext,instance):
print "auth called"
popup = Popup(title="success",
content=Label(text=mytext),
size=(100, 100),
size_hint=(0.3, 0.3),
auto_dismiss=False)
popup.open()
为什么我没有获得通过自我.user包含字符串的auth函数mytext variabe?
我收到AssertionError: None is not callable
。