Dialog Window

BlitzPlus Forums/BlitzPlus Programming/Dialog Window

Ked(Posted 2007) [#1]
I'm not sure who all knew this, but if you want to create a dialog window in Blitz+ all you have to do is create your main window then create the dialog window and make it a child gadget to the main window.

Example:
mainwindow=CreateWindow("TEST",50,50,640,480,Desktop(),1+2)
button=CreateButton("BABY!",50,50,150,150,mainwindow)

dialogwindow=0

Repeat
	Select WaitEvent()
		Case $803
			Select EventSource()
				Case mainwindow
					End
				
				Case dialogwindow
					FreeGadget dialogwindow
					dialogwindow=0
					EnableGadget mainwindow
					ActivateGadget mainwindow
			End Select
		
		Case $401
			Select EventSource()
				Case button
					If dialogwindow=0
					DisableGadget mainwindow
						dialogwindow=CreateWindow("DIALOG",1024/2-250/2,768/2-250/2,250,250,mainwindow,1)
					EndIf
			End Select
	End Select
Forever