-
Notifications
You must be signed in to change notification settings - Fork 1
/
demo_widgets_returns.mojo
36 lines (32 loc) · 1.12 KB
/
demo_widgets_returns.mojo
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
from ui import *
def main():
var GUI = Server()
var pos = Position(128,128,1.0)
var s:String = ""
var t:String = "23:59"
var c:String = "#3584E4"
var i:Int = 0
var i2:Int = 0
var b:Bool = False
var message:String = "Empty"
while GUI.Event():
with GUI.Window(message,pos,"background-color:"+c):
GUI.Text('s = '+s)
GUI.Text('i = '+str(i))
GUI.Text('b = '+str(b))
GUI.Text('i2= '+str(i2))
GUI.Text('t = '+str(t))
GUI.Text('c = '+str(c))
if GUI.ComboBox("Choice",i,"a","b"):
message = "ComboBox: "+str(i)
if GUI.Button("Click"): message = "Click"
if GUI.TextInput("Edit",s):
message = "TextInput: "+ s
if GUI.Toggle(b,"CheckBox"):
message = "CheckBox: "+ str(b)
if GUI.Slider("Slider",i2):
message = "Slider: "+ str(i2)
if GUI.TimeSelector(t):
message = "TimeSelector: "+t
if GUI.ColorSelector(c):
message = "ColorSelector: "+c