Exemple #1
0
def demo(ctx):
    """show a quick Flexx demo
    """
    from flexx.ui.examples.demo import Demo
    from flexx import app
    app.launch(Demo)
    app.run()
Exemple #2
0
def runner(cls):
    t = app.launch(cls, 'firefox')  # fails somehow with XUL
    t.test_init()
    app.call_later(TIMEOUT1, app.stop)
    app.run()
    if not (ON_TRAVIS and ON_PYPY):  # has intermittent fails on pypy3
        t.test_check()
    t.session.close()
Exemple #3
0
"""
Simple hello world that does not explicitly create an app, making the
button appear in the "default" app. Convenient for interactive use.

This does currently not work anymore. We might enable creating widget
elements like this again, but for now, it would need to be associated
with a session explicitly.
"""

from flexx import app, ui

b = ui.Button(text='Hello world!')

app.run()
Exemple #4
0
                with ui.BoxLayout(flex=2, orientation='horizontal'):
                    ui.Button(text='Box A', flex=1)
                    ui.Button(text='Box B', flex=2)
                    ui.Button(text='Box C is a bit longer', flex=3)

            ui.Widget(flex=0, style='min-width:20px')

            with ui.BoxPanel(flex=1, orientation='vertical'):

                with ui.BoxPanel(flex=1, orientation='horizontal'):
                    ui.Button(text='Box A', flex=0)
                    ui.Button(text='Box B', flex=0)
                    ui.Button(text='Box C is a bit longer', flex=0)
                with ui.BoxPanel(flex=0, orientation='horizontal'):
                    ui.Button(text='Box A', flex=1)
                    ui.Button(text='Box B', flex=1)
                    ui.Button(text='Box C is a bit longer', flex=1)
                with ui.BoxPanel(flex=1, orientation='horizontal'):
                    ui.Button(text='Box A', flex=1)
                    ui.Button(text='Box B', flex=0)
                    ui.Button(text='Box C is a bit longer', flex=2)
                with ui.BoxPanel(flex=2, orientation='horizontal'):
                    ui.Button(text='Box A', flex=1)
                    ui.Button(text='Box B', flex=2)
                    ui.Button(text='Box C is a bit longer', flex=3)


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