Part 2 β UI Rendering [Simplest UI Application]
In this part, you will learn to create a basic UI application.
Table of contents
Step 1 β HTML file
This is very similar to a modal window application. But now instead of a modal window β a whole browser page!
you can preview your HTML in our Application Designer
Let's create some simple HTML:
src/gui.html
<div>
<sly-field title="INFO: Test massage"
description="this is a common template for displaying information"
style="padding-top: 0; padding-bottom: 0">
<sly-icon slot="icon" :options="{ color: '#13ce66', bgColor: '#e1f7eb', rounded: false }">
<i class="zmdi zmdi-info"></i>
</sly-icon>
</sly-field>
<sly-field title="WARNING: Test message"
description="this is a common template for displaying warnings">
<sly-icon slot="icon" :options="{ color: '#fba607', bgColor: '#ffeee3', rounded: false }">
<i class="zmdi zmdi-alert-triangle"></i>
</sly-icon>
</sly-field>
<sly-field title="ERROR: Test message"
description="this is a common template for displaying errors">
<sly-icon slot="icon" :options="{ color: '#de1212', bgColor: '#ffebeb', rounded: false }">
<i class="zmdi zmdi-alert-circle"></i>
</sly-icon>
</sly-field>
</div>Step 2 β Python Script
To keep the application running all the time, we will use the app.run method.
src/main.py
Step 3 β Updating debug.env && config.json
Write
TASK_IDWhile True Script from Part 7 todebug.envWe also need to specify the path along which our application can cache debugging dataDEBUG_APP_DIRandDEBUG_CACHE_DIR
debug.env
Write path to GUI file to
config.json
config.json
Step 4 β Results
PreviousPart 1 β While True Script [It's all what you need]NextPart 3 β APP Handlers [Handle Events and Errors]
Last updated
Was this helpful?