2
我是kivy的新手,並嘗試從kv生成的按鈕中運行myApp類中的do_login函數。Kivy運行kv按鈕的功能
我千伏佈局按鈕
RelativeLayout:
FloatingActionButton:
id: float_act_btn
on_press: ???how to call call do_login from MyApp
我與含有do_login功能
class MyApp(App):
def build(self):
main_widget = Builder.load_string(login_kv)
def do_login(self, *args):
print'jo'
類如何使用on_press打電話do_login?
與on_press:do_login(login.text,password.text) '我得到 'do_login' 沒有定義,並與self.do_login同我得到MaterialRaisedButton' 對象有沒有屬性 'do_login'