Alexander Koval Asked:2020-03-23 19:07:47 +0000 UTC2020-03-23 19:07:47 +0000 UTC 2020-03-23 19:07:47 +0000 UTC 当您单击kivy设置中的关闭按钮时,如何调用更新应用程序本身的gui的方法 772 这是按钮: btn_settings = Button(text="settings", pos_hint={"center_y": 0.97, "center_x": 0.75}, size_hint=(0.5, 0.06), on_release=lambda x: App.open_settings(self)) 当你点击它时,App类的方法——open_settings被调用,设置被打开。然后我制作了一个单独的更新按钮,但在我看来,当您单击关闭按钮时,有一种方法可以进行这些更新。 感谢您在我的问题上花费的时间。 python-3.x 1 个回答 Voted Best Answer Alexander Koval 2020-03-27T14:49:48Z2020-03-27T14:49:48Z 我自己决定了这个问题,如果有人需要它,它会在文档中描述。我找到了两个解决方案:1)def on_config_change(self, config, section, key, value): print("change config", config, "section", section, "key", key, "value", value) 2)def close_settings(self, *largs): pass 由于该类是从App类继承的,这些方法已经在其中描述了,我们只需覆盖这些方法并为我们的代码描述逻辑。我得到了第一个选项。
我自己决定了这个问题,如果有人需要它,它会在文档中描述。我找到了两个解决方案:1)
def on_config_change(self, config, section, key, value): print("change config", config, "section", section, "key", key, "value", value)2)
def close_settings(self, *largs): pass由于该类是从App类继承的,这些方法已经在其中描述了,我们只需覆盖这些方法并为我们的代码描述逻辑。我得到了第一个选项。