Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import remi.gui as gui
- from remi import start, App
- import os
- class MyApp(App):
- def __init__(self, *args):
- res_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), 'res')
- #static_file_path can be an array of strings allowing to define
- # multiple resource path in where the resources will be placed
- super(MyApp, self).__init__(*args, static_file_path=res_path)
- def idle(self):
- #idle loop, you can place here custom code
- # avoid to use infinite iterations, it would stop gui update
- pass
- def main(self):
- #creating a container GridBox type
- main_container = gui.GridBox(width='100%', height='100%', style={'margin':'0px auto'})
- #defining layout matrix
- main_container.define_grid(['abbaaa',
- 'aacc',
- 'aaabbaa'])
- label = gui.Label('This is the a label')
- label.style['background-color'] = 'green'
- button = gui.Button('Button')
- text = gui.TextInput()
- main_container.append(label,'abba')
- main_container.append(button,'aa')
- main_container.append(text,'cc')
- # returning the root widget
- return main_container
- if __name__ == "__main__":
- # starts the webserver
- start(MyApp, address='127.0.0.1', port=8081, websocket_port=0, host_name=None, start_browser=True, username=None, password=None)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement