Just a simple example to show this nice new feature in PB4!

Code: Select all
OpenWindow(0,0,0,300,300,"Main Window",#PB_Window_ScreenCentered|#PB_Window_SystemMenu)
ButtonGadget(0,10,10,100,20,"Show other window")
Procedure OtherWindow()
OpenWindow(1,0,0,200,200,"Other Window",#PB_Window_WindowCentered,WindowID(0))
ButtonGadget(1,10,10,100,20,"Close window")
EndProcedure
Repeat
WindowEvent = WaitWindowEvent()
Select WindowEvent
Case #PB_Event_Gadget
Select EventGadget()
Case 0
OtherWindow()
DisableWindow(0,#True)
StickyWindow(1,#True)
Case 1
CloseWindow(1)
DisableWindow(0,#False)
SetActiveWindow(0)
EndSelect
EndSelect
Until WindowEvent = #PB_Event_CloseWindow