Closing a window

BlitzMax Forums/BlitzMax GUI Programming/Closing a window

Not sure want you mean as the link does not work.

But may this helps:



Local test:TGadget = CreateWindow:TGadget("test",278,97,472,316,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE |WINDOW_MENU |WINDOW_STATUS )
		Local ChildWindow1:TGadget = CreateWindow:TGadget("ChildWindow1",141,22,284,230,test:TGadget,WINDOW_TITLEBAR|WINDOW_TOOL |WINDOW_CHILD)
		Local Button1:TGadget = CreateButton:TGadget("Show Window",34,112,82,33,test:TGadget,BUTTON_PUSH)

Repeat
	WaitEvent()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			Select EventSource()
				Case test test_WC( test:TGadget )
				Case ChildWindow1 ChildWindow1_WC( ChildWindow1:TGadget )
			End Select
		Case EVENT_GADGETACTION
			Select EventSource()
				Case Button1 Button1_GA ( ChildWindow1:TGadget )
			End Select
	End Select
Forever

Function test_WC ( Window:TGadget )
	End
End Function

Function ChildWindow1_WC ( Window:TGadget )

	HideGadget( Window:TGadget )

End Function

Function Button1_GA ( Window:TGadget )
	ShowGadget( Window:TGadget )
	
End Function




You could also replace the HideGadget with FreeGadget if don't use the window again.

does it help?

jsp