1
1
import CTK
2
+ import time
2
3
3
4
def error (x ):
4
5
raise Exception ("Bad dog!!!!" )
@@ -16,15 +17,18 @@ def ok(x):
16
17
OPTIONS = [('one' ,'uno' ), ('two' ,'dos' ), ('three' , 'tres' )]
17
18
18
19
def apply ():
20
+ if CTK .post ['server!tri' ]:
21
+ time .sleep (2 )
22
+
19
23
return {'ret' : "ok" }
20
24
21
25
class default :
22
26
def __init__ (self ):
23
27
a = CTK .PropsAuto ('/apply' )
24
- a .Add ('Name ' , CTK .TextField ({'name' : "server!uno" }), 'Example 1 ' )
25
- a .Add ('Surname ' , CTK .TextField ({'name' : "server!dos" }), 'Lalala ' )
26
- a .Add ('Nick ' , CTK .TextField ({'name' : "server!tri" }), 'Oh uh ah! ' )
27
- a .Add ('Active' , CTK .Checkbox ({'name' : "server!active" , 'checked' :1 }), 'Nuevo ' )
28
+ a .Add ('To upcase ' , CTK .TextField ({'name' : "server!uno" }), 'Converts the content of the field to upcase ' )
29
+ a .Add ('Shows error ' , CTK .TextField ({'name' : "server!dos" }), 'It shows an error, it does not matter what you write ' )
30
+ a .Add ('Delay 2secs ' , CTK .TextField ({'name' : "server!tri" }), 'It delays response for 2 seconds, so the submitting message is shown ' )
31
+ a .Add ('Active' , CTK .Checkbox ({'name' : "server!active" , 'checked' :1 }), 'It \' s just a plain checkbox. Nothing to see here ' )
28
32
29
33
b = CTK .PropsAuto ('/apply' )
30
34
b .Add ('Elige' , CTK .Combobox ({'name' : "server!elec" , 'selected' : "two" }, OPTIONS ), 'la lista' )
0 commit comments