deep2.pyΒΆ

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
"""
Example to mix BoxPanel and VBox, which at some point failed in Chrome. Now
Flexx takes precautions to make it work. This example is to test that it
still works.
"""

from flexx import app, ui


class Red(ui.Widget):
    CSS = '.flx-Red { background: #ff0000;}'


class Deep2(ui.Widget):

    def init(self):

        with ui.VBox():

            ui.Label(text='Widgets in BoxPanels in a widget in a vbox')

            with ui.Widget(flex=1):
                with ui.VFix():
                    with ui.HFix():
                        Red(flex=1)
                        Red(flex=1)
                    with ui.HFix():
                        Red(flex=1)
                        Red(flex=1)


if __name__ == '__main__':
    m = app.launch(Deep2, 'app')
    app.run()