Disable all Row/Column components at once

Is it possible, to set a parameter like disabled to all objects contained in a pn.Row/pn.Column layout at once?

The following minimal example disables “level 1” components.
I want to disable all 4 components at once, without checking if a component is a Row/Column again.

import panel as pn

togg1 = pn.widgets.ToggleGroup(name='ToggleGroup', options=['A', 'B'])
ddl1 = pn.widgets.Select(name="ddl1", options=[1,2,3])
togg2 = pn.widgets.ToggleGroup(name='ToggleGroup', options=['C', 'D'])
ddl2 = pn.widgets.Select(name="ddl2", options=[4,5,6])

comp2 = pn.Column(togg2, ddl2)
container = pn.Column(togg1, ddl1, comp2)

for c in container:
    c.disabled = True

# instead of looping over all Row/Column components and check for nested elements,
# I want to do:
container.disabled = True
# (which doesn't change anything on the components

container

image

I think pn.WidgetBox().disabled or pn.WidgetBox().loading might work

Thank you @ahuang11 for your reply, but I don’t think this is what I am looking for as far as I understand the WidgetBox() docs correctly.

Let me try being more concise:
I have a panel layout which is deeply nested with other Rows, Columns, widgets and panes.
Q1: Is that generally a bad approach to have a nested, complex hierarchy?

I want to programmatically disable such a layout as a whole - or all it’s widgets at least.
That cannot be done with e.g. container.disabled = True as it doesn’t propagate the disabled parameter to all child elements.
Q2: How can I iterate through resp. traverse the nested container layout, independend of the current panel object type?

While this naive, recursive approach to Q2 works for the example from the original code:

def dis_enable_components(pn_comp, disabled=True):
    if issubclass(type(pn_comp), pn.widgets.base.Widget):
        pn_comp.disabled = disabled
    elif type(pn_comp) == pn.layout.base.Column or type(pn_comp) == pn.layout.base.Row:
        for c in pn_comp:
            dis_enable_components(c, disabled)
            
dis_enable_components(container, True)

but in my more complex real use-case, the top-level container of type panel.layout.base.Column returns a list with a single entry which is panel.param.ParamFunction object.
Then above approach doen’t work already.

Q3 ~= Q2: So if there is no way to easily disable all panel widgets inside a pn.Layout container, what is the best way to traverse such a layout tree to disable each widget manually?