我想在选取物品被按下时实现on_touch_down函数,但不知道如何实现它。

huangapple go评论95阅读模式
英文:

I want to implement the on_touch_down function when a pick is pressed, but don't know how to implement it

问题

我想要在我的Python文件中,当这个图像被按下时,我想要使用on_touch_down函数而不是on_release函数。如果有人能提供任何帮助,我将不胜感激。

    def __init__(self, **kwargs):
        super(ProfileWindow, self).__init__(**kwargs)
        self.profileimage = ImageButton(source= "icons/profilepic.png", pos_hint={"center_x": 0.5, "center_y": 0.65})
        self.profileimage.bind(on_touch_down= self.imagechange)
        self.add_widget(self.profileimage)

感谢未来的帮助。

英文:

I want when this image in my python file is pushed, I want to use the on_touch_down function instead the on_release function. if anyone could be of any assistance I would appreciate it.

    def __init__(self, **kwargs):
        super(ProfileWindow, self).__init__(**kwargs)
        self.profileimage = ImageButton(source= "icons/profilepic.png", pos_hint={"center_x": 0.5, "center_y": 0.65})
        self.profileimage.bind(on_release= self.imagechange)
        self.add_widget(self.profileimage)

Thanks for future assistance

答案1

得分: 0

Use on_press instead of on_release.

英文:

Use on_press instead of on_release.

huangapple
  • 本文由 发表于 2020年1月6日 23:01:04
  • 转载请务必保留本文链接:https://go.coder-hub.com/59614344.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定