FloatLayout:
Image:
size_hint: .5,.6
pos_hint: {'x': 0, 'y':.4}
allow_stretch: True
keep_ratio:False
on_touch_down: result.text = 'image1'
source: "images/image1.png"
FloatLayout:
Image:
size_hint: 0.5,.6
pos_hint: {'x': 0.5, 'y':.4}
allow_stretch: True
keep_ratio:False
on_touch_down:result.text = 'image2'
source: "images/image2.png"
BoxLayout:
size_hint: 1,.1
pos_hint: {'x': 0, 'y':.3}
Label:
text: 'your choose is '
id: result
Do not use on_touch_down.
Create an image that uses ButtonBehavior, and use on_release
See the example of the IconButton: https://kivy.org/doc/stable/api-kivy.uix.behaviors.html?highlight=iconbutton#adding-behaviors
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/126e46b9-4b1e-44a7-af2f-02a6c95aa7e1%40googlegroups.com.
class Image_example(FloatLayout,ButtonBehavior):
pass
Image_example:
FloatLayout:
Image:
size_hint: .5,.6
pos_hint: {'x': 0, 'y':.4}allow_stretch: True keep_ratio:False
on_release:R.text= 'image1'
source: "images/image1.png"
FloatLayout:
Image:
size_hint: 0.5,.6
pos_hint: {'x': 0.5, 'y':.4}
allow_stretch: True
keep_ratio:False
on_release:R.text= 'image2'
source: "images/image2.png"
BoxLayout:
size_hint: 1,.1
pos_hint: {'x': 0, 'y':.3}
Label:
text: ''
id: R
AttributeError: release
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-...@googlegroups.com.
On Mar 30, 2020, at 11:43 AM, husam alkdary <husamal...@gmail.com> wrote:
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/7c254c9e-7aa8-43c6-9918-535676a01c7b%40googlegroups.com.