ae.kivy_iterable_displayer

iterable displayer widget

the popup widget provided by this ae namespace portion displays items and subitems of any type of iterables, like dicts, lists, sets and tuples.

iterable displayer usage

to open a popup displaying the keys/indexes and values of any iterable, create an instance of the class IterableDisplayerPopup. you can specify a popup window title string via the title kwarg and pass the iterable to the data kwarg (or property):

dict_displayer = IterableDisplayerPopup(title="popup window title", data=iterable_data)

a widget will be automatically instantiated for each subitem of iterable_data to display the item key and value. the used widget class is depending on the type of the subitem. for non-iterable subitems the IterableDisplayerLabel widget will be used. if instead a subitem contains another iterable, then IterableDisplayerPopup will use the IterableDisplayerButton class, which when tapped displays another instance of IterableDisplayerPopup with the sub-subitems.

Note

the string in the title property may be shortened automatically by FlowPopup, depending on the width of the popup layout and the font_size app state.

Classes

IterableDisplayerPopup(**kwargs)

FlowPopup displaying iterable data - useful for quick prototyping and debugging.

class IterableDisplayerPopup(**kwargs)[source]

Bases: FlowPopup

FlowPopup displaying iterable data - useful for quick prototyping and debugging.

data

the iterable (dict, list, set, tuple) from which the items will be shown

static compile_data_maps(data)[source]

re-create data maps if the data attribute changes.

Parameters:

data (Union[dict, list, set, tuple]) – dict/list/set/tuple data to display (==self.data binding).

Returns:

list of dicts to be assigned to self.child_data_maps.