response time for button click too slow

15 views
Skip to first unread message

Madhura Bhogate

unread,
Jan 21, 2018, 10:36:59 PM1/21/18
to Kivy users support
Hi kivy users,

I am a MAC user and I created a virtual env for python 3.6.3 version.
Whenever I create buttons and add on_release feature to it fails to detect the right button being clicked.
Is the response time for button too slow ? 

 My pip freeze looks as below-

certifi==2017.11.5

chardet==3.0.4

Cython==0.26.1

docutils==0.14

idna==2.6

Kivy==1.10.0

Kivy-Garden==0.1.4

pygame==1.9.3

Pygments==2.2.0

requests==2.18.4

urllib3==1.22



I created a simple app. Below is the code:

I have two buttons - Heads and Tails and depending on which button is clicked the label text is set.


Scenario: If I have clicked on heads, the label shows 'heads'. Next if I click the 'tails' button, it still clicks heads.

I have to click on the 'tails' button several times till it detects it. Why is this so ?


Is this expected ? Or am I missing something in my setup/config/code?


=========================cointoss.py =================================

from kivy.app import App
from kivy.uix.boxlayout import BoxLayout


class CoinTossBoxLayout(BoxLayout):
def choice(self, guess):
self.ids.result.text = 'You clicked the %s button!' % guess


class CoinTossApp(App):

def build(self):
return CoinTossBoxLayout()


if __name__ == '__main__':
CoinTossApp().run()


====================cointoss.kv ======================
<CoinTossBoxLayout>:
orientation: 'vertical'
Label:
text: 'Welcome to the Heads or Tails!'
font_size: 50
BoxLayout:
orientation: 'horizontal'
Button:
text: 'Heads'
on_release: root.choice('heads')
Button:
text: 'Tails'
on_release: root.choice('tails')
Label:
id: result
text: ''
font_size: 40

===================================================

ZenCODE

unread,
Jan 23, 2018, 10:58:06 AM1/23/18
to Kivy users support
And how does it behave if you use 'on_press' instead? That might reveal something...
Reply all
Reply to author
Forward
0 new messages