Is this a bug?

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

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

; button howto

window=CreateWindow("w00t!",0,0,640,480)

MyButton=CreateButton("click here!",8,8,80,24,window)
MyOtherButton=CreateButton("click here too!",8,32,80,24,window)

Repeat
	WaitEvent()
	If EventID()=$803 quit=1
	
	If EventID()=$401
		If EventSource()=MyButton Notify "w00! button 1"
		If EventSource()=MyOtherButton Notify "w00! button 2"		
	EndIf
Until quit
End




Nnotice how the indenting at the creation of the menu items also makes things clear.
; windowmenus howto

window=CreateWindow("w00t!",0,0,640,480)

Menu_file=CreateMenu("&File",0,WindowMenu(window))
	Menu_Open=CreateMenu("&Open",1,Menu_file)
	CreateMenu "",99999,Menu_file
	Menu_Save=CreateMenu("&Save",2,Menu_file)
	Menu_SaveAs=CreateMenu("Save &As",3,Menu_file)
	CreateMenu "",99999,Menu_file	
	Menu_Quit=CreateMenu("&Quit",4,Menu_file)
Menu_edit=CreateMenu("&Edit",100,WindowMenu(window))
	Menu_Cut=CreateMenu("C&ut",101,Menu_edit)
	Menu_Copy=CreateMenu("&Copy",102,Menu_edit)
	Menu_Paste=CreateMenu("&Paste",103,Menu_edit)
Menu_Tools=CreateMenu("&Tools",200,WindowMenu(window))
	Menu_Showmoney=CreateMenu("&Showmoney",201,Menu_tools)
Menu_help=CreateMenu("&Help",300,WindowMenu(window))
	Menu_About=CreateMenu("&About",301,Menu_help)

UpdateWindowMenu window ; otherwise you won't see changes




MyButton=CreateButton("click here!",8,8,80,24,window)
MyOtherButton=CreateButton("click here too!",8,32,80,24,window)

Repeat
	WaitEvent()
	If EventID()=$803 quit=1
	
	If EventID()=$401
		If EventSource()=MyButton Notify "w00! button 1"
		If EventSource()=MyOtherButton Notify "w00! GANGBANG!"		
	EndIf
	
	If EventID()=$1001
		Select EventData()
			Case 1
				a$=RequestFile("anything..")
			Case 2
				a$=RequestFile("anything..",True)
			Case 3
				a$=RequestFile("anything..",True)
			Case 101
				Notify "cut"
			Case 102
				Notify "copy"
			Case 103
				Notify "paste"
			Case 201
				If MenuChecked(Menu_Showmoney) UncheckMenu Menu_Showmoney Else CheckMenu Menu_Showmoney
				UpdateWindowMenu window
			Case 301
				Notify "Random stuph"+Chr(13)+"All rights reserved"
		End Select

	EndIf
Until quit
End