G.U.I Function

Miscellaneous Forums/General Discussion/G.U.I Function

When creating G.U.I stuff like windows, should you make a
seperate function for it, or just do something like this-
main=CreateWindow("MAIN",300,300,400,500,main,15)
button=CreateButton("Hello",200,200,100,100,main,1)
list=CreateListBox(100,200,200,200,main)
AddGadgetItem List,"TIME"
AddGadgetItem List,"PLACE"
;Functions
Function Apocalypse()
	While WaitEvent<>$803
		If WaitEvent()=$803 Then 
		Notify("Its the Apocalypse!") 
		EndIf 
	Wend
	End
End Function			
Function Start()
	While WaitEvent()<>$803 
		If EventID()=$401
		If EventSource()=button
		Notify("Hope it worked!")
	     EndIf
	     EndIf 	
	Wend 
        End
End Function
Apocalypse()
Start()
End 




NOT A PROBLEM! just wanted to know what you guys would reccomend. P.S if you test, please tell me why
the button won't work.

Not sure what your trying to do, but this makes a button work?

But The second function would never execute due to the "END" command.

AND I dont know what the $803 if for? etc.

I would try starting with one of the Examples, there should be an example of a PUSH BUTTON and how to handle the EVENTs included in your BMAX.

main=CreateWindow("MAIN",300,300,400,500,main,15)
Global button:TGadget=CreateButton("Hello",200,200,100,100,main,1)
list=CreateListBox(100,200,200,200,main)
AddGadgetItem List,"TIME"
AddGadgetItem List,"PLACE"
'';Functions
Function Apocalypse()
While WaitEvent()
If EventSource()=button Then
Notify("Its the Apocalypse!")
EndIf
Wend
End Function

Function Start()
While WaitEvent()
Print EventID()
If EventSource()=button
Notify("Hope it worked!")
EndIf
Wend
End Function
Apocalypse()
Start()
End

Sounds like this is a BlitzPlus or MaxGui question, so i'd suggest asking on the correct forum

I don't have Blitz Max I'm a Blitz Plus programmer, I just
wanted to know what you'd guys'd do; its alright no problem
forget about my question.