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

Linux specific forum
Little John
Addict
Addict
Posts: 4803
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

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

Post 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
Last edited by Little John on Sun Mar 13, 2016 1:59 pm, edited 1 time in total.
User avatar
ts-soft
Always Here
Always Here
Posts: 5756
Joined: Thu Jun 24, 2004 2:44 pm
Location: Berlin - Germany

Re: Can't see which gadget has the focus

Post by ts-soft »

you have to focus with keyboard ones, an than you should see the focus:
Image
PureBasic 5.73 | SpiderBasic 2.30 | Windows 10 Pro (x64) | Linux Mint 20.1 (x64)
Old bugs good, new bugs bad! Updates are evil: might fix old bugs and introduce no new ones.
Image
Justin
Addict
Addict
Posts: 956
Joined: Sat Apr 26, 2003 2:49 pm

Re: Can't see which gadget has the focus

Post 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.
Little John
Addict
Addict
Posts: 4803
Joined: Thu Jun 07, 2007 3:25 pm
Location: Berlin, Germany

Re: Can't see which gadget has the focus

Post 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!
Post Reply