Changed the following for beta4:
- added #PB_Window_NoGadgets for OpenWindow()
- UseGadgetList() returns the previous gadgetlist window handle
- UseGadgetList() can restore the complete gadget stack (panel/containergadgets). Before, the stack was always reset.
- UseGadgetList(0) changes nothing and returns the current gadget window
Will work like this:
Code: Select all
If OpenWindow(0, 0, 0, 500, 500, "Main Window", #PB_Window_SystemMenu|#PB_Window_ScreenCentered)
ButtonGadget(0, 10, 10, 150, 25, "Button 1")
; Create Window with #PB_Window_NoGadgets to prevent automatic GadgetList creation
If OpenWindow(1, 0, 0, 300, 200, "Child Window", #PB_Window_TitleBar|#PB_Window_WindowCentered|#PB_Window_NoGadgets, WindowID(0))
OldGadgetList = UseGadgetList(WindowID(1)) ; Create GadgetList and store old GadgetList
ButtonGadget(10, 10, 10, 150, 25, "Child Window Button")
UseGadgetList(OldGadgetList) ; Return to previous GadgetList
EndIf
ButtonGadget(1, 10, 45, 150, 25, "Button 2") ; This will be on the main window again
Repeat
Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf