我想知道是否可以将 kivy 微调器值显示为移动标签,以便用户确切知道滑块的当前值是什么.
I was wondering whether it was possible to displays kivy spinner values as a moving label, so that the user knows exactly what the current value of the slider is.
谢谢
你只需绑定一个监听器到值改变事件
you just bind a listener to the value change event
some_label = Label(...)
my_slider = Slider(...)
def OnSliderValueChange(instance,value):
some_label.text = str(value)
my_slider.bind(value=OnSliderValueChange)
正如 .kv 文件中指出的那样,您可以执行类似的操作
as inclement points out in the .kv file you could do something like
<PongGame>:
...
canvas:
Rectangle:
...
Label:
...
text: str(slider_id.value)
Slider:
...
id: slider_id
这篇关于在更改时显示 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 - 自动更改角色颜色)