weird loopy jamming my app

BlitzPlus Forums/BlitzPlus Beginners Area/weird loopy jamming my app

As soon as i run this app, I click file, quit.
It doesn't work.

but if I do file->quit->file->quit it works.. I have to do it twise... whats worng with my code? O.o

If I move the window and the do file->quit on startup it works but if I don't touch the window and just click file, open or exit... it wont work right away.

The way Im using to handle the menu is the same way as in the tutorial within blitz+

mainwindow	=CreateWindow( "Practice", 10, 10, 640, 480)

mainmenu	=WindowMenu(mainwindow) 

file		=CreateMenu("File",0,mainmenu)
CreateMenu "Open",1,file
CreateMenu "",0,file
CreateMenu "Quit",3,file

UpdateWindowMenu mainwindow

; -----------------------------------------------------------------------------
; Main Loop
; -----------------------------------------------------------------------------

Repeat
; [X] Will Now Close the Window
If WaitEvent()=$803 Then End
; Check Menu Events
If WaitEvent()=$1001 Then
	Select EventData()
		Case 1 ; Open
			Notify "You clicked oepn!"
		Case 3 ; Exit
			End
	End Select
End If

Until KeyDown(1)
End