Child Windows (MaxGui)

BlitzMax Forums/BlitzMax Programming/Child Windows (MaxGui)

as far as i make out its all done with disable gadget
Type tapp
	
	Field mwindow:tgadget
	Field pwindow:tgadget
	
	Field sbutton:Tgadget
	
	Method New()
	
		mwindow = CreateWindow("main window", 0, 0, ClientWidth(Desktop()), ClientHeight(Desktop()))
		MaximizeWindow mwindow
		
		pwindow = CreateWindow("Popup", 100, 100, 200, 200, Null, 65)
		HideGadget pwindow
		
		sbutton = CreateButton("popup", 10, 10, 100, 20, mwindow)
		
	End Method
	
End Type

Global mapp:tapp = New tapp

While True

	WaitEvent
	
	Select EventID()
	
		Case event_windowclose
		
			Select EventSource()
				
				Case mapp.mwindow
					End
				
				Case mapp.pwindow
					EnableGadget mapp.mwindow
					HideGadget mapp.pwindow
					
			End Select
			
		Case event_gadgetaction
			
			If EventSource() = mapp.sbutton Then 
				DisableGadget(mapp.mwindow)
				ShowGadget(mapp.pwindow)
			EndIf
			
	End Select
	

Wend