ae.kivy_iterable_displayer

iterable displayer widget

The popup widget provided by this ae namespace portion displays items and sub-items 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 an iterable simple instantiate 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 sub-item of iterable_data to display the item key and value. The used widget class is depending on the type of the sub-item. For non-iterable sub-items the IterableDisplayerLabel widget will be used. If instead a sub-item is containing another iterable then IterableDisplayerPopup will use the IterableDisplayerButton class, which when tapped displays another instance of IterableDisplayerPopup with the sub-sub-items.

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.

_container: Widget
attach_to: Optional[Widget]
_layout_finished: bool
_opened_item: Optional[Widget]
_touch_moved_outside: bool