Question

I'm trying to set the focus from one widget to the next one using the focusNextChild() method. It works, but I there seems to be a slight difference between using the tab-key or doing things in code. If the next control is a button, using the tab-key results in a focused button with its caption surrounded with little dots, so you see immediately which control has the focus. Using code no dots are visible. How can I force the dots to appear?

Was it helpful?

Solution

This problem (that the focus rectangle is not drawn except when using explicit keyboard focussing; e.g. using the tab-key) could be a result of how the chosen theme (and window manager?) chooses to render the given element.

Some themes may choose to draw focus rectangles around 'any' element which receives focus, while others will only draw focus rectangles when explicitely using 'keyboard' navigation.

In short: this is probably a theme-specific issue.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top