Would it be safer to add the #WS_CLIPCHILDREN Style, to differentiate them as for the Canvas container ?
Code: Select all
EnableExplicit
Enumeration Window
#Window
EndEnumeration
Enumeration Gadgets
#Frame_Container
#Button_Container
#Frame
#Button
EndEnumeration
Procedure IsFrameContainer(Gadget)
Protected Result
Result = Random(1, 0)
;If GetWindowLongPtr_(GadgetID(Gadget), #GWL_STYLE) & #WS_CLIPCHILDREN
; Result = #True
;EndIf
ProcedureReturn Result
EndProcedure
Procedure Open_Window_0(X = 0, Y = 0, Width = 400, Height = 340)
If OpenWindow(#Window, 0, Y, Width, Height, "Title", #PB_Window_SystemMenu | #PB_Window_MinimizeGadget | #PB_Window_ScreenCentered)
FrameGadget(#Frame_Container, 60, 20, 280, 130, "Frame Container", #PB_Frame_Container | #PB_Frame_Flat)
;SetWindowLongPtr_(GadgetID(#Frame_Container), #GWL_STYLE, GetWindowLongPtr_(GadgetID(#Frame_Container), #GWL_STYLE) | #WS_CLIPCHILDREN)
ButtonGadget(#Button_Container, 30, 30, 220, 80, "Button in Container")
CloseGadgetList()
FrameGadget(#Frame, 60, 180, 280, 130, "Frame ", #PB_Frame_Flat)
ButtonGadget(#Button, 90, 210, 220, 80, "Button")
ProcedureReturn #True
EndIf
EndProcedure
If Open_Window_0()
Debug "#Frame_Container is a Container : " + Str(IsFrameContainer(#Frame_Container))
Debug "#Frame is a Container : " + Str(IsFrameContainer(#Frame))
Repeat : Until WaitWindowEvent() = #PB_Event_CloseWindow
EndIf

