It is currently Mon Apr 12, 2021 5:00 am

All times are UTC + 1 hour

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: [Done] BindGadgetEvent bug
PostPosted: Fri Aug 17, 2018 9:43 am 
PureBasic Expert
PureBasic Expert

Joined: Sun Aug 08, 2004 5:21 am
Posts: 3715
Location: Netherlands
Procedure LostFocus()
  Debug "Active gadget [Lost focus, Bind] : "+Str(GetActiveGadget())

If OpenWindow(0, 0, 0, 322, 205, "Lost focus", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
  StringGadget(0, 8,  10, 306, 20, "0")
  StringGadget(1, 8,  35, 306, 20, "1")
  StringGadget(2, 8,  60, 306, 20, "2")
  BindGadgetEvent(0, @LostFocus(), #PB_EventType_LostFocus)
  BindGadgetEvent(1, @LostFocus(), #PB_EventType_LostFocus)
  BindGadgetEvent(2, @LostFocus(), #PB_EventType_LostFocus)
    Event = WaitWindowEvent()
    If Event = #PB_Event_Gadget
      Select EventType()
        Case #PB_EventType_LostFocus
          Debug "Active gadget [Lost focus, Event] : "+Str(GetActiveGadget())
  Until Event = #PB_Event_CloseWindow

The value reported for GetActiveGadget() for the lost focus event isn't the same when using BindGadgetEvent compared to the normal event loop.
When using BindGadgetEvent it often reports the old gadget which has lost focus still as the active gadget.

macOS 10.15 Catalina, Windows 10

Reply with quote  
 Post subject: Re: BindGadgetEvent bug
PostPosted: Fri Apr 12, 2019 4:35 pm 

Joined: Fri May 17, 2002 4:39 pm
Posts: 14194
Location: France

Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC + 1 hour

Who is online

Users browsing this forum: No registered users and 2 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye