我阅读了 Kivy 教程,但找不到如何禁用小部件(例如,按钮).
I read the Kivy tutorial and couldn't find how to disable a widget (for example, a Button).
def foo(self, instance, *args):
#... main business logic, and then
instance.disable = False
# type(instance) = kivy.uix.Button
我将 foo 与 functools.partial 绑定.
什么是正确的参数?
如果你使用的是 kivy 版本 >= 1.8 那么你可以做 widget.disabled = True.如果在以前的版本中您可以简单地自行管理禁用,只需确保它不会对触摸做出反应并在禁用时显示另一种外观.
If you are using kivy version >= 1.8 then you can just do widget.disabled = True. If on previous versions you can simply manage the disabling yourself, just make sure it doesn't react to touch and displays a alternative look when disabled.
这篇关于如何禁用 Kivy 中的小部件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
如何制作一个在 Python 中提供角色的不和谐机器人How to make a discord bot that gives roles in Python?(如何制作一个在 Python 中提供角色的不和谐机器人?)
Discord 机器人没有响应命令Discord bot isn#39;t responding to commands(Discord 机器人没有响应命令)
你能得到“关于我"吗?Discord 机器人的功能?Can you Get the quot;About mequot; feature on Discord bot#39;s? (Discord.py)(你能得到“关于我吗?Discord 机器人的功能?(不和谐.py))
message.channel.id Discord PYmessage.channel.id Discord PY(message.channel.id Discord PY)
如何在 heroku 上托管我的 discord.py 机器人?How do I host my discord.py bot on heroku?(如何在 heroku 上托管我的 discord.py 机器人?)
discord.py - 自动更改角色颜色discord.py - Automaticaly Change an Role Color(discord.py - 自动更改角色颜色)