AnyLumino
API referencelayout

KeyedChildren

Keyed access to the children of a composed anylumino widget.

Lumino layout widgets and Astryx widgets share this base. Children are stored as a synced widgets list of rendered views plus a parallel child_keys list. get_widget returns the view that renders in the browser and get_owner returns the object that was passed in, so wrapper objects exposing a widget attribute keep their own API. Subscripting returns the owner. Widgets with a selected_index trait also gain selected_key and select_key.

Attributes

attributewidgetslist[Any]
attributechild_keyslist[str]
attributetitleslist[str]
attributeselected_keystr | None
attributeselected_widgetobject | None
attributeselected_ownerobject | None

Functions

funcget_index(key) -> int
paramkeystr

Returns

int
funcget_key(index) -> str
paramindexint

Returns

str
funcget_widget(key_or_index) -> object
paramkey_or_indexstr | int

Returns

object
funcget_owner(key_or_index) -> object
paramkey_or_indexstr | int

Returns

object
funcselect_key(key) -> None
paramkeystr

Returns

None
funcapply_widget(key_or_index, callback) -> Any
paramkey_or_indexstr | int
paramcallbackCallable[[object], Any]

Returns

typing.Any
funcapply_owner(key_or_index, callback) -> Any
paramkey_or_indexstr | int
paramcallbackCallable[[object], Any]

Returns

typing.Any
funccall_widget(key_or_index, method_name, *args, **kwargs) -> Any
paramkey_or_indexstr | int
parammethod_namestr
paramargsAny
= ()
paramkwargsAny
= {}

Returns

typing.Any
funccall_owner(key_or_index, method_name, *args, **kwargs) -> Any
paramkey_or_indexstr | int
parammethod_namestr
paramargsAny
= ()
paramkwargsAny
= {}

Returns

typing.Any
funcadd(key, widget, *, title=None, select=False) -> None
paramkeystr
paramwidgetobject
paramtitlestr | None
= None
paramselectbool
= False

Returns

None
funcadd_widget(widget, title=None, *, key=None, select=False) -> None
paramwidgetobject
paramtitlestr | None
= None
paramkeystr | None
= None
paramselectbool
= False

Returns

None
funcremove_widget(key_or_index, *, close=False) -> object

Remove a child and return the owner that was passed in.

Pass close=True to also close the removed widget models. Closing releases them from the ipywidgets registry and makes them unusable, so the default keeps the returned owner alive for the caller to reuse.

paramkey_or_indexstr | int
paramclosebool
= False

Returns

object
funcmove_widget(key_or_index, index) -> None

Move a child to a new position, keeping keys and titles aligned.

paramkey_or_indexstr | int
paramindexint

Returns

None
funcrename_widget(key_or_index, title) -> None
paramkey_or_indexstr | int
paramtitlestr

Returns

None

On this page