Ejemplo n.º 1
0
def button_pile(buttons):
    width = 14
    for button in buttons:
        width = max(widget_width(button), width)
    return _Padding(Pile(buttons),
                    min_width=width,
                    width=width,
                    align='center')
Ejemplo n.º 2
0
def button_pile(buttons):
    max_label = 10
    for button in buttons:
        button = button.base_widget
        if not isinstance(button, Button):
            raise RuntimeError("button_pile takes a list of buttons, not %s", button)
        max_label = max(len(button.label), max_label)
    width = max_label + 4
    return _Padding(Pile(buttons), min_width=width, width=width, align='center')