peterhinch / micropython-micro-gui

A lightweight MicroPython GUI library for display drivers based on framebuf, allows input via pushbuttons. See also micropython-touch.
MIT License
247 stars 37 forks source link

Feature/Question: Set default active(focused) input on screen #12

Closed petrkr closed 2 years ago

petrkr commented 2 years ago

Will be handy to select which input will be default after screen shows up.. Now it's most left button or widget.

But I have buttons layout (in HW) as SWITCH and SELECT. and OnScreen I have "No, Yes" buttons, but No is selected as first. I know I can swap on-screen buttons, but would be handy to pre-select that "YES" one, which is right (same as SELECT/ENTER button is on right side)

peterhinch commented 2 years ago

See this part of the doc. You have full control over which object is the default and the order in which they are subsequently selected.

petrkr commented 2 years ago

Oh yea, that works. I swap also creating of elements to make it "logically" in code from left-->right order.. So yes, if I will initialize first item which I want to be default, then it works.

I read doc, but not too carefully to find this section. I look for it around widget / buttons sections