So you already had panels/gadgets with the window as parent? Then make this new Panel the parent for all. (As in: first make this new panel, then proceed with the rest of the app)
local window:TGadget=CreateWindow(..)
local windowpanel:TGadget=CreatePanel(0,0,clientwidth(window),clientheight(window),window)
' list of your own application stuff, buttons, panels, etc.
local MyGadget:TGadget=CreateWhatever(.. .. ,windowpanel)
local MyGadget2:TGadget=CreateWhatever(.. .. ,windowpanel)
etc.
local window:TGadget=CreateWindow(..)
local windowpanel:TGadget=CreatePanel(0,0,clientwidth(window),clientheight(window),window)
' list of your own application stuff, buttons, panels, etc.
local MyGadget:TGadget=CreateWhatever(.. .. ,windowpanel)
local MyGadget2:TGadget=CreateWhatever(.. .. ,windowpanel)
etc.