Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/python/352.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 关闭Kivy中的弹出窗口_Python_Kivy - Fatal编程技术网

Python 关闭Kivy中的弹出窗口

Python 关闭Kivy中的弹出窗口,python,kivy,Python,Kivy,我在Kivy中为弹出窗口内的一个按钮分配了一个关闭弹出窗口功能。最类似帖子中的解决方案不起作用: 以下是我的python代码: def display_list(self): show = ListPopup() self.popupWindow = Popup(title="Wortliste", content=show, size_hint=(None,N

我在Kivy中为弹出窗口内的一个按钮分配了一个关闭弹出窗口功能。最类似帖子中的解决方案不起作用:

以下是我的python代码:

def display_list(self):
    show = ListPopup()
    self.popupWindow = Popup(title="Wortliste", 
                        content=show, 
                        size_hint=(None,None),
                        size=(800,1600),
                        pos_hint={'right': 0.95, 'top': 1})
    self.popupWindow.open()

def dismiss_list_popup(self):
    self.popupWindow.dismiss()

class ListPopup(GridLayout):
    def words_found(self):
        if word_list == []:
           return "Noch nichts gefunden"
        else:
            display_liste = "".join([word + "\n" for word in word_list])
            return display_liste '''
这是kivy文件的相关部分:

<ListPopup>:
    Button:
        text: "Schließen"
        id: popup_close
        size_hint_y: 0.1
        on_release: root.dismiss_list_popup() '''
所以问题是,kivy文件中的root是指ListPopup类,而不是我想忽略的弹出窗口“self”也不这样做,因为“self”指的是按钮


你能在这里帮我找到正确的参考资料吗?或者告诉我如何更好地解决这个问题?

信息不足。请发一封信。
AttributeError: 'ListPopup' object has no attribute 'dismiss_list_popup'