Bug or Not : AddWindowTimer + EventWindow()
Posted: Thu May 09, 2019 4:32 am
				
				Hello everybody! 
I hope everything is fine for you and I thank you for reading me.
Here is a first code that works correctly:
- if I click on window 0, I have events on window 0
- if I click on window 1, I have events on the window 1
Problems happen when you install a timer:
One realizes that by clicking in the window 1, events like 512,513,514 are generated with as ID the window 0 which posed me problem and does not seem to me desirable ...
What do you think?
			I hope everything is fine for you and I thank you for reading me.
Here is a first code that works correctly:
- if I click on window 0, I have events on window 0
- if I click on window 1, I have events on the window 1
Code: Select all
If OpenWindow(0, 0, 0, 300, 600, "fenetre 0", #PB_Window_SystemMenu )
  
  OpenWindow(1, 310, 0, 300, 600, "fenetre 1", #PB_Window_SystemMenu,WindowID(0) )
  Repeat 
    event= WaitWindowEvent() 
    
    If event<>0 And event<>13110 And event<>275 ;retire quelques évenement commun
      Debug "Evenement PRINC : |"+EventWindow()+" | "+event
    EndIf
  
  Until event= #PB_Event_CloseWindow
EndIfProblems happen when you install a timer:
Code: Select all
If OpenWindow(0, 0, 0, 300, 600, "fenetre 0", #PB_Window_SystemMenu )
  
  OpenWindow(1, 310, 0, 300, 600, "fenetre 1", #PB_Window_SystemMenu,WindowID(0) )
  AddWindowTimer(0,1,100)
  Repeat 
    event= WaitWindowEvent() 
    
    If event<>0 And event<>13110 And event<>275 ;retire quelques évenement commun
      Debug "Evenement PRINC : |"+EventWindow()+" | "+event
    EndIf
    
  Until event= #PB_Event_CloseWindow
EndIfWhat do you think?