how do i disable a widget based on the value of another widget in Kivy

Viewed 1081

I have a Spinner widget in a .kv file and I need the value of this Spinner to enable another Spinner widget.

This is the code i have tried and it does not work and gives me a Syntax error:

CustLabel:
    text: "Aux LO Pump Status"


CustSpinner:
    id: auxlo
    text: "Select"
    values: ('On', 'Off')
    focus: True
    on_state: (self.auxlonum.disabled) if (self.auxlo == 'off')

CustLabel:
    text: "Aux LO Pump Number"

CustSpinner:
    id: auxlonum
    text: "Select"
    values: ('# 1', '# 2')
    focus: True

i would actually prefer the auxlonum widget to start off disabled and 'greyed out' and then only be enabled if the auxlo widget had 'on' selected, however i was not sure how to go about this.

Thank you.

1 Answers
Related