5.40LTS - LostFocus event not always triggered

Mac OSX specific forum
Niffo
Enthusiast
Enthusiast
Posts: 500
Joined: Tue Jan 31, 2006 9:43 am
Location: France

5.40LTS - LostFocus event not always triggered

Post by Niffo »

In the following snippet and on MacOS Only, the lostfocus event is never triggered when clicking on the button (who does not seems to get focus), unless you manually set the focus to it (see commented line) :

Code: Select all

OpenWindow(0, 100, 100, 300, 200, "StringGadget LostFocus test")
StringGadget(0, 10, 10, 50, 20, "String")
ButtonGadget(1, 10, 50, 50, 20, "Button")
SetActiveGadget(0)

Repeat
   Select WaitWindowEvent()
      Case #PB_Event_Gadget
         Select EventGadget()
            Case 0 ; StringGadget
               Select EventType()
                  Case #PB_EventType_LostFocus
                     Debug "#PB_EventType_LostFocus"
               EndSelect
            Case 1 ;ButtonGadget
               ;SetActiveGadget(1)
         EndSelect
      Case #PB_Event_CloseWindow
         Break
   EndSelect
ForEver
Niffo
hoerbie
Enthusiast
Enthusiast
Posts: 119
Joined: Fri Dec 06, 2013 11:57 am
Location: DE/BY/MUC

Re: 5.40LTS - LostFocus event not always triggered

Post by hoerbie »

Fred
Administrator
Administrator
Posts: 16619
Joined: Fri May 17, 2002 4:39 pm
Location: France
Contact:

Re: 5.40LTS - LostFocus event not always triggered

Post by Fred »

I think it's on OS X thing: the focus doesn't get transferred to buttons when pressing on them. I tested other OS X apps, and it always behave like this, so you will probably have to adapt your program to handle this special case (BTW, the focus is still on the stringgadget(), so it's not really a bug)
Post Reply