Pinboard

Example:

from flexx import ui

class Example(ui.Widget):
    def init(self):
        with ui.PinboardLayout():
            self.b1 = ui.Button(text='Stuck at (20, 20)', pos=(20, 30),
                                base_size=(100, 100))
            self.b2 = ui.Button(text='Dynamic at (30%, 30%)', pos=(0.3, 0.3))
            self.b3 = ui.Button(text='Dynamic at (50%, 70%)', pos=(0.5, 0.7))
open in new tab


class flexx.ui.PinboardLayout(*init_args, **kwargs)

Inherits from: Layout

Unconstrained absolute and relative positiong of child widgets.

The “pos” signal of each child is used to position it. Values smaller than 1 are considered relative positions, otherwise the position is in pixels. The “size” signal is similarly used to determine the size of each child. If omitted (i.e. (0, 0)), the child widget will have its natural size.