dalerank / nanogui-sdl

Minimalistic port of NanoGUI claim works with SDL API w/o external dependencies.
Other
437 stars 77 forks source link

Programmatic way of setting focus on button? #52

Closed Fredrum closed 3 years ago

Fredrum commented 3 years ago

Hi! I'm trying to select+highlight a button using just a function (I will later tie that to Gamepad input) but I can't get the effect I'm expecting.

I'm trying button1->requestFocus(); and button1->setFocused();

but none of those makes the button highlight as if I have the mouse cursor over it. This works though, button1->setBackgroundColor(Color(0, 255, 255, 250));

It does seem to activate/focus on the button's parent mini window though. Which is odd as the set color works correctly.

Im I going about it the wrong way?

Cheers