File size: 1,623 Bytes
936e0a7
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
### Dialog
import simplestart as ss

ss.md("## ss.dialog")

ss.space()

ss.md('''
---
#### πŸ”… Example
''')

def testme():
    ss.message("testme")
    
def showit():
    if ss.session["str_fullscreen"] != "":
        dialog.show(fullscreen = True)
    else:
        dialog.show()
    
def myclose(event):
    ss.message("dialog close with result " + event.value)
    
dialog = ss.dialog("Dialog Title",  onclose=myclose)
with dialog:
    ss.text("SimpleStart dialog demostration")
    ss.md("---")
    ss.button("testme", onclick=testme)
    ss.md(":smile:")
        
cols = ss.columns([60,"flex:40; border-left:1px solid lightgray"], border=True, style="border:1px solid lightgray")
with cols[0]:
    mytext = ss.text("This is dialog")
    ss.button("show dialog", onclick=showit)
    
def mycheck(event):
    if event.value == True:
        ss.session["str_fullscreen"] = "fullscreen = True"
        #dialog.show(fullscreen = True)
    else:
        ss.session["str_fullscreen"] = ""

with cols[1]:
    ss.text("Dialog Options")
    ss.checkbox("Fullscreen", onchange=mycheck)

ss.space()
ss.write('''
---
#### πŸ”Ž Code
''')

ss.md('''
```python
import simplestart as ss

def myclose(event):
    ss.message("dialog close with result " + event.value)
    
dialog = ss.dialog(title="Dialog Title", onclose=myclose)
with dialog:
    ss.text("Opening from the bottom")
    ss.md("---")
    ss.button("testme", onclick=testme)
    ss.md(":smile:")
    
def showit():
    dialog.show(@str_fullscreen)
    
ss.button("show dialog", onclick=showit)
```
''')

def onPageEnter():
    ss.session["str_fullscreen"] = ""