Gadget Actions

BlitzPlus Forums/BlitzPlus Programming/Gadget Actions

here you go, this is from the repeat down:
Repeat ; - MAIN LOOP -

;No need to flush events.
;FlushEvents()
; Wait till someone presses that important X!
;Use wait event only once..  
ThisEvent = WaitEvent()

If ThisEvent=$803
If EventSource()=mainWindow
Exit
Else
HideGadget EventSource()
EnableGadget mainwindow
ActivateWindow mainWindow
End If

Else If ThisEvent=$401 ; - Wait till someone presses the Add Task button
If EventSource()=addTaskButt
DisableGadget mainWindow
ShowGadget addTaskWin
End If 
End If

Forever

End ; - QUIT 


Everytime you use waitevent the program stops until someone does something. Even though you checked for an event on one waitevent, it wont stay in the event queue when you call waitevent again.. Meaning that the user will have to press the button again on the second waitevent to queue up the event again.

Hope this helps.