Code: Select all
Enumeration
#Window1
#Window2
#Button
#XML
EndEnumeration
XML$ = "<window id='#PB_Any' name='Child' text='test' minwidth='auto' minheight='auto' flags='#PB_Window_WindowCentered | #PB_Window_SystemMenu'></window>"
ParseXML(#XML, XML$)
Procedure OnChildWindowClosed()
CloseWindow(DialogWindow(#Window2))
FreeDialog(#Window2)
DisableWindow(#Window1, 0)
EndProcedure
Procedure OnButtonPressed()
CreateDialog(#Window2)
OpenXMLDialog(#Window2, #XML, "Child", 0, 0, 200, 150, WindowID(#Window1))
BindEvent(#PB_Event_CloseWindow, @OnChildWindowClosed(), DialogWindow(#Window2))
DisableWindow(#Window1, 1)
EndProcedure
OpenWindow(#Window1, 0, 0, 300, 200, "", #PB_Window_SystemMenu | #PB_Window_ScreenCentered)
ButtonGadget(#Button, 10, 10, 90, 32, "Open...")
BindGadgetEvent(#Button, @OnButtonPressed())
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow And EventWindow() = #Window1