使用Kivy Popup

时间:2018-01-16 22:14:00

标签: python kivy

我想在一个函数中使用两个类 Popup 的代数(问题的原理在下一个代码中)。我该如何解决?

class TextInputPopup(Popup):
    def __init__(self, **kwargs):
        super(TextInputPopup, self).__init__(**kwargs)
        . . . 
        . . .
        . . .
    def get_used button(self):
         . . .
         if test == 8:  # test for exaple
             return 'yes'
         else:
             return 'no'

class SaveAs(BoxLayout):
    teinp = ObjectProperty()

    def __init__(self, **kwargs):
        super(SaveAs, self).__init__(**kwargs)

    def on_call_popup(self):
        poti = TextInputPopup('Directory Manager', 'DirName')
        poti.open()
        poti.bind(on_dismiss=self.next_step)
        result = poti.get_used_button()

        if result == 'yes':

            poti2 = TextInputPopup('File Manager', 'FileName')
            poti2.open()
            poti2.bind(on_dismiss=self.next_step2)
        return

1 个答案:

答案 0 :(得分:0)

您是否尝试同时创建两个弹出窗口?因为我认为Kivy实际上不允许你这样做?