tuikit/layouts/layout.py
author Radek Brich <radek.brich@devl.cz>
Sun, 15 Feb 2015 17:50:24 +0100
changeset 116 165b5d65e1cb
parent 115 b4ff7392003a
permissions -rw-r--r--
Drop AnchorLayout, merge its features into FixedLayout.

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