Page 1 of 1

[solved] Can't see which gadget has the focus

Posted: Sun Mar 13, 2016 12:33 pm
by Little John
Hi,

the following code seems to work as expected, i.e. when I press repeatedly [Space] and [Tab], then the Debug window shows
Gadget #0
Gadget #1
Gadget #2
Gadget #0
etc.
However, I can't see which gadget has the focus. This is of course required in a real program.
It's the same whether I don't specify a subsystem, or whether I specify "gtk2" as subsystem.

Is there any trick for displaying the focus rectangle?

Code: Select all

; PB 5.42 LTS x64 on Linux Mint 17.3 Cinnamon

OpenWindow(0, 0, 0, 150, 150, "Focus test")
ButtonGadget(0, 30,  20, 80, 30, "Button 0")
ButtonGadget(1, 30,  60, 80, 30, "Button 1")
ButtonGadget(2, 30, 100, 80, 30, "Button 2")
SetActiveGadget(0)

Repeat
   event = WaitWindowEvent()
   Select event
      Case #PB_Event_Gadget
         Debug "Gadget #" + GetActiveGadget()
   EndSelect      
Until event = #PB_Event_CloseWindow

Re: Can't see which gadget has the focus

Posted: Sun Mar 13, 2016 12:55 pm
by ts-soft
you have to focus with keyboard ones, an than you should see the focus:
Image

Re: Can't see which gadget has the focus

Posted: Sun Mar 13, 2016 1:11 pm
by Justin
I had the same problem, it is a theme issue, some themes don't display focus cues. I use mint and i think the adawita theme shows them.

Re: Can't see which gadget has the focus

Posted: Sun Mar 13, 2016 1:58 pm
by Little John
ts-soft wrote:you have to focus with keyboard ones
Sorry, I do not understand.
Justin wrote:I had the same problem, it is a theme issue, some themes don't display focus cues. I use mint and i think the adawita theme shows them.
Previously, the default theme on Mint 17.3 Cinnamon was active here,
choosing an appropriate theme now solved the issue.
Many thanks!