Forum Archive

Simple Switch question

donnieh

In a .pyui file I have a switch (switch1) placed inside a scroll view. How do I define it and get it's value?

omz

You can access views by name using a dict-like notation:

v = ui.load_view()
# ...
my_switch = v['scrollview1']['switch1']
donnieh

Thank you :)