tuikit/layouts/layout.py
author Radek Brich <radek.brich@devl.cz>
Sun, 22 Feb 2015 09:53:13 +0100
changeset 119 dd91747504dd
parent 116 165b5d65e1cb
permissions -rw-r--r--
Redraw widgets on request. Add scrollbar demo.

class Layout:

    def __init__(self):
        self._managed_widgets = []

    def add(self, widget, *args, **kwargs):
        """Add widget to layout.

        Additional arguments may be used by specialized layouts as hints.

        """
        self._managed_widgets.append(widget)

    def update(self, w, h):
        """Rearrange managed widgets in given space.

        `w`, `h` is available horizontal and vertical space,
        or width and height of parent container of managed widgets.

        """
        pass