Is this a bug?

BlitzPlus Forums/BlitzPlus Beginners Area/Is this a bug?

I created a G.U.I test to see how buttons and such could
assist me in a program, and when I used my code based
on Mak's simple_button program I was surprised to find
that my code that was nearly identical to Maks' despite
some lack of white space, did not work. Here's Mak's code
and my code.
Maks:

;create main window
window=CreateWindow( "Main window",0,0,400,300 )

;create a centred button
button=CreateButton( "Click Me",ClientWidth(window)/2-32,ClientHeight(window)/2-12,64,24,window )

;wait for an event...
While WaitEvent()<>$803

	;was it a gadget action event?
	If EventID()=$401
	
		;yes! was it from the button?
		If EventSource()=button
		
			;Yep!
			Notify "Right on!"
			
		EndIf
	EndIf
	
Wend

End

My code:
Function Start()
	While Not Apocalypse()
		If WaitEvent()=$401
		If EventSource()=button Then 
		Notify("Hope it worked!")
		Else
		If SelectedGadgetItem("TIME")
		Notify("TIME")
	      EndIf
	     EndIf 	
	EndIf 	     				
	Wend 
        End
End Function 

This is just a test. I'm clueless, I've seriously tried
just about anything a begginer could think of-Global,
different loops etc.