I don't understand why nothing happens when I select window or if I close a window, the whole program closes ?! Thanks in advance !
Code: Select all
@DISPLAY 1, {X=50,Y=150, Width=100, Height=100,color=#WHITE}
Win1=CreateDisplay(NIL, {X=50,Width=200, Height=200,color=$FF0000}) OpenDisplay(Win1)
Win2=CreateDisplay(NIL, {X=300,Width=200, Height=200, color=$00FF00}) OpenDisplay(Win2)
Win3=CreateDisplay(NIL, {X=550,Width=200, Height=200, color=$0000FF}) OpenDisplay(Win3)
Function p_EventFunc(msg)
Switch msg.action
CASE "ActiveWindow": DebugPrint(msg.id)
CASE "CloseWindow": DebugPrint(msg.id)
EndSwitch
EndFunction
; listen to these events!
InstallEventHandler({CloseWindow = p_EventFunc, ActiveWindow = p_EventFunc})
EscapeQuit(True)
; Boucle infinie
Repeat
WaitEvent
Forever