Child Windows?

BlitzMax Forums/BlitzMax GUI Programming/Child Windows?

Could someone please show me how to create a window that is a child to another window and that doesn't leave the parent window's borders?

Officially,MDI child windows aren't supported by MaxGUI as a cross platform solution is currently unavailable. What would you have been using them for?

As Seb said, they are not supported !!
Nevertheless they were working using the old MaxGui. So if you don't yet use the new MaxGuiEx, here is an example:
Local MainWindow:TGadget = CreateWindow:TGadget("MainWindow",272,149,365,193,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE |WINDOW_STATUS |WINDOW_CLIENTCOORDS )
	Local ChildWindow:TGadget = CreateWindow:TGadget("ChildWindow",243,71,99,105,MainWindow:TGadget,WINDOW_TITLEBAR|WINDOW_TOOL |WINDOW_CHILD)

Repeat
	WaitEvent()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			Select EventSource()
				Case MainWindow	MainWindow_WC( MainWindow:TGadget )
				Case ChildWindow	ChildWindow_WC( ChildWindow:TGadget )
			End Select

	End Select
Forever

Function MainWindow_WC( Window:TGadget )
	DebugLog "Window MainWindow wants to be closed"

	End
End Function

Function ChildWindow_WC( Window:TGadget )
	DebugLog "Window ChildWindow wants to be closed"

	End
End Function



Quick note to all people using the new Win32MaxGUIEx:
This code works the same with the new module:
Import MaxGUI.Win32MaxGUI

Local MainWindow:TGadget = CreateWindow:TGadget("MainWindow",272,149,365,193,Null,WINDOW_TITLEBAR|WINDOW_RESIZABLE |WINDOW_STATUS |WINDOW_CLIENTCOORDS )
	Local ChildWindow:TGadget = CreateWindow:TGadget("ChildWindow",243,71,99,105,MainWindow:TGadget,WINDOW_TITLEBAR|WINDOW_TOOL |WINDOW_CHILD)

Repeat
	WaitEvent()
	Select EventID()
		Case EVENT_WINDOWCLOSE
			Select EventSource()
				Case MainWindow	MainWindow_WC( MainWindow:TGadget )
				Case ChildWindow	ChildWindow_WC( ChildWindow:TGadget )
			End Select

	End Select
Forever

Function MainWindow_WC( Window:TGadget )
	DebugLog "Window MainWindow wants to be closed"

	End
End Function

Function ChildWindow_WC( Window:TGadget )
	DebugLog "Window ChildWindow wants to be closed"

	End
End Function