0

The problem is that I can fire an event when a button is pressed, but the button release is not working; here is my .kv code:

Button:
    id: my_custom_label
    text: 'SOS'
    height: "95dp"
    width: "160dp"
    on_press: app.sendprogress()   # this is working
    on_release : app.sendhelp()    # this is not working
    size_hint: None, None
    pos_hint: {'center_x': .1, 'center_y': .1}
    canvas.before:
        PushMatrix
        Rotate:
            angle: 0
            origin: self.center
    canvas.after:
        PopMatrix

The error I am seeing is this:

32:               on_press: app.sendprogress()
>> 33:               on_release : app.sendhelp()
34:               size_hint: None, None
35:        pos_hint: {'center_x': .1, 'center_y': .1}
...
Invalid property name
1
  • Can we see the sendhelp() method? Commented Mar 26, 2014 at 19:16

1 Answer 1

3

Try remove the space before the colon: i.e. instead of on_release : app.sendhelp() do on_release: app.sendhelp(). I think that you're not allowed to have a space there.

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. I was not aware that spaces are not allowed and I was thinking of some logical mistake.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.