Good Afternoon,
Using MicroGui with ESP32 with PSRAM and ILI9341 display
I am trying to algorithmically set the visible button in a buttonlist stack.
Firstly, is it possible? it seems to me that .value should allow me to do this
"value Optional args button=None, new_cb=False. The button arg, if provided, should be a button in the set. If supplied and the button is not active the currency changes to the supplied button, which is displayed. By default the callback of the previous button is run, otherwise the callback of the newly displayed button."
But what is the name of the button in the set if the buttons have been created by .add_button?
my code
lightswitch[z] = ButtonList(my_callbacktest)
for t in btable:
lightswitch[z].add_button(wri, slocation[z][1]+15, labcol-6, shape=RECTANGLE, height=16, width=16, text=slocation[z][0], **t)
Thank you for your consideration.
Cheers
Barry
MicroGui: Set visible button in Buttonlist stack
- pythoncoder
- Posts: 5956
- Joined: Fri Jul 18, 2014 8:01 am
- Location: UK
- Contact:
Re: MicroGui: Set visible button in Buttonlist stack
The add_button method returns the button object (as stated in the README). This can be used as the argument to value. You don't need a name for a button (they don't have one) - you use the Button instance.
Peter Hinch
Index to my micropython libraries.
Index to my micropython libraries.
Re: MicroGui: Set visible button in Buttonlist stack
Thank you Peter