split.py

open in new tab
 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
"""
Splitter widgets are cool!
"""

from flexx import app, ui


class Split(ui.Widget):

    def init(self):

        with ui.SplitPanel(orientation='horizontal'):
            ui.Widget(style='background:#f00')
            with ui.SplitPanel(orientation='vertical'):
                ui.Widget(style='background:#0f0')
                with ui.SplitPanel(orientation='horizontal'):
                    ui.Widget(style='background:#ff0')
                    with ui.SplitPanel(orientation='vertical'):
                        ui.Widget(style='background:#f0f')
                        with ui.SplitPanel(orientation='horizontal'):
                            ui.Widget(style='background:#0ff')
                            ui.Widget(style='background:#00f')


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