Flexx

来自开放百科 - 灰狐
跳转到: 导航, 搜索

Flexx

指南

sudo pip install flexx 或
git clone https://github.com/zoofio/flexx
python3 setup.py install 
git clone https://github.com/tornadoweb/tornado
python3 setup.py install  
>>> from flexx import app, ui
>>> b = ui.Button(text='Hello world!') 
Serving apps at http://localhost:49270/

hello_world.py

from flexx import app, ui, react
from tornado import ioloop
class Example(ui.Widget):
    def init(self):
        self.count = 0
        with ui.HBox():
            self.button = ui.Button(text='Click me', flex=0)
            self.label = ui.Label(flex=1)
    @react.connect('button.mouse_down')
    def _handle_click(self, down):
        if down:
            self.count += 1
            self.label.text('clicked %i times' % self.count)
main = app.launch(Example)
app.run()

python3 hello_world.py

图集

链接

分享您的观点
个人工具
名字空间

变换
操作
导航
工具箱