I just bought BlitzPlus... Help, please!

BlitzPlus Forums/BlitzPlus Beginners Area/I just bought BlitzPlus... Help, please!

The Forum Archive is locked. These are the original blitzbasic.com forums, kept so their posts can still be read and searched. No new topics, replies or edits can be made here. To join the conversation, head over to the Blitz3D+ forums.

take a look at the code below, we only need to call waitevent once, events can be checked using 'event' var it will contain the last generated event.

Global filename
filename="project2"
Global filewin

Window1=CreateWindow("Program",500,300,400,300)
SetMinWindowSize Window1,400,300
SetStatusText Window1,"©2008 ÆroBlu Software"

menu=WindowMenu(Window1)
file=CreateMenu("File",0,menu)

CreateMenu("New",1,file)
CreateMenu("Open",2,file)
CreateMenu("",0,file)
CreateMenu("Save",3,file)
CreateMenu("Save as...",4,file)
CreateMenu("",0,file)
CreateMenu("Quit",5,file)

Function newfilewindow()
	filewin=CreateWindow("TEST",525,335,350,240,0,17)
End Function

UpdateWindowMenu Window1
;--->>MAIN<>LOOP<<---;
Repeat


event = WaitEvent() 
Select event 
	
	Case $1001	; menu action events 
		EID=EventData()
		Select EID
			Case 1
				newfilewindow()
			Case 2
				AppTitle("Open")
				Notify("Open")

			Case 3
				AppTitle("Save")
				Notify("Save")

			Case 4
				AppTitle("Save as...")
				Notify("Save as...")

			Case 5
				AppTitle("Are You Sure?")
				result=Confirm("Are You Sure You Want to Quit?",True)
				If result=1 Then
					End
				EndIf
		End Select
		
	Case $803 ; close window events
		window_closed = EventSource() 
		Select window_closed 
			Case Window1 
				Notify "You clicked to close Window1"
			Case filewin
				Notify "You clicked to close filewin"
				HideGadget filewin 
		End Select 

End Select 

Forever

End 


code tags are {code} {/code} but change '{' and '}' for '[' and ']'

kev