Skip to content

Container#

Available in backends: qt, ipynb

Signals#

  • changed(object) - Emitted with self when any sub-widget in the container changes.
  • label_changed(str) - Emitted when the widget label changes.
  • native_parent_changed(object) - Emitted with the backend widget when the widget parent changes.

Container #

Bases: ContainerWidget[WidgetVar]

A Widget to contain other widgets.

Note that Container implements the typing.MutableSequence interface, so you can use it like a list to add and remove widgets.

Parameters:

  • widgets (Sequence[Widget], default: () ) –

    A sequence of widgets with which to initialize the container, by default None.

  • layout (str, default: 'vertical' ) –

    The layout for the container. must be one of {'horizontal', 'vertical'}. by default "vertical"

  • scrollable (bool, default: False ) –

    Whether to enable scroll bars or not. If enabled, scroll bars will only appear along the layout direction, not in both directions.

  • labels (bool, default: True ) –

    Whether each widget should be shown with a corresponding Label widget to the left, by default True. Note: the text for each widget defaults to widget.name, but can be overridden by setting widget.label.

  • **base_widget_kwargs (Any, default: {} ) –

    All additional keyword arguments are passed to the base magicgui.widgets.Widget constructor.