How to use the flexx.ui.Button function in flexx

To help you get started, we’ve selected a few flexx examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github flexxui / flexx / flexxamples / testers / tricky_events.py View on Github external
def init(self):
        with ui.VBox():

            self.reset = ui.Button(text='Reset event system')
            with ui.HFix(flex=1):
                SyncedSlidersWrong(flex=1)
                SyncedSlidersRight(flex=1)

            ui.Widget(flex=1)  # spacer
github flexxui / flexx / examples / ui-tests / box_performance.py View on Github external
def init(self):
        with ui.PinboardLayout():
            self.b1 = ui.Button(text='Stuck at (20, 20)', pos=(20, 30))
            self.b2 = ui.Button(text='Dynamic at (20%, 20%)', pos=(0.2, 0.2))
            self.b3 = ui.Button(text='Dynamic at (50%, 70%)', pos=(0.5, 0.7))
github flexxui / flexx / flexxamples / testers / ws_speed.py View on Github external
def init(self, pycomp):
        self.pycomp = pycomp
        self._start_time = 0
        self._start_times = []

        with ui.VBox():
            with ui.HBox() as self.buttons:
                ui.Button(text='1 x 1 MiB roundtrip')
                ui.Button(text='1 x 5 MiB roundtrip')
                ui.Button(text='10 x 1 MiB roundtrip')
                ui.Button(text='10 x 5 MiB roundtrip')
                ui.Button(text='100 x 1 MiB roundtrip')
                ui.Button(text='100 x 5 MiB roundtrip')
            self.progress = ui.ProgressBar()
            self.status = ui.Label(text='Status: waiting for button press ...',
                                   wrap=1, flex=1, style='overflow-y:scroll;')
github flexxui / flexx / flexxamples / testers / errors.py View on Github external
def init(self, pycomponent):
        self.py = pycomponent

        with ui.VBox():
            self.b1 = ui.Button(text='Raise error in JS action')
            self.b2 = ui.Button(text='Raise error in JS reaction')
            self.b3 = ui.Button(text='Raise error in Python action')
            self.b4 = ui.Button(text='Raise error in Python reaction')
            ui.Widget(flex=1)  # spacer
github flexxui / flexx / examples / ui-tests / box_performance.py View on Github external
def init(self):
            layout = ui.PlotLayout()
            layout.add_tools('Edit plot',
                                ui.Button(text='do this'),
                                ui.Button(text='do that'))
            layout.add_tools('Plot info', 
                                ui.ProgressBar(value='0.3'),
                                ui.Label(text='The plot aint pretty'))
github AB-CE / abce / abcEconomics / gui / loadform.py View on Github external
def init(self):
        with ui.Widget(style="overflow-y: scroll"):
            with ui.VBox(style="overflow-y: scroll") as self.vbox:
                name_descriptions = [(d['name'], d['description'])
                                     for d in abcEconomics.parameter_database.all()]
                for name, desc in name_descriptions:
                    with ui.GroupWidget():
                        btn = ui.Button(title=name, text=name)
                        delete = ui.Button(title=name, text='(del)')
                        ui.Label(text=desc)

                    btn.connect('mouse_click', self.wdg)
                    delete.connect('mouse_click', self.delete)
github flexxui / flexx / flexx / ui / examples / hello_world1.py View on Github external
"""
Simple hello world that demonstrates an interactive style for writing
simple apps. An empty widget is launched as an app, and other widgets
are added to it.

In an environment that runs the asyncio event loop in the REPL (e.g. Pyzo)
one can add and remove widgets interactively.
"""

from flexx import app, ui

app.init_interactive()

m = app.launch(ui.Widget)  # Main widget

b1 = ui.Button(text='Hello', parent=m)
b2 = ui.Button(text='world', parent=m)

app.run()
github AB-CE / abce / abcEconomics / gui / loadform.py View on Github external
def update(self, event):
        with self.vbox:
            with ui.GroupWidget():
                btn = ui.Button(title=event['name'],
                                text=event['name'])
                delete = ui.Button(title=event['name'], text='del')
                ui.Label(text=event['description'])
            btn.connect('mouse_click', self.wdg)
            delete.connect('mouse_click', self.delete)