我kivy.factory.Factory用来打开弹出窗口,但是当我想关闭它们时它不起作用。代码:from kivy.app import Appfrom kivy.lang import Builderx = Builder.load_string("""#:import F kivy.factory.Factory#:import Window kivy.core.window.WindowScreen: Button: text: 'Press to Open First Popup' on_press: F.FirstPopup().open()<FirstPopup@Popup>: title: 'First Popup' size_hint: None, None width: Window.width / 1.4 height: Window.width / 1.4 Button: text: 'Press to Open Second Popup' on_press: F.SecondPopup().open()<SecondPopup@Popup>: title: 'Second Popup' size_hint: None, None width: Window.width / 1.8 height: Window.width / 1.8 Button: text: 'Press to Close Both Popups' on_press: root.dismiss() F.FirstPopup().dismiss() # < DOSEN'T WORK""")class MyApp(App): def build(self): return xMyApp().run()
添加回答
举报
0/150
提交
取消