Improved handling of case where child is killed by a signal
[tcl-tlc.git] / examples / wizard.tcl
blob2436567d464e7582ed5007e850f63daacbcfd156
1 #!/usr/bin/env tclsh8.4
3 # vim: ft=tcl foldmethod=marker foldmarker=<<<,>>> ts=4 shiftwidth=4
5 package require TLC 0.90.0
7 source "boilerplate.tcl"
9 Wizard .wizard -startpage start -routing {
10 start { #<<<
11 Next {
12 {$dat(usefoo)} get_foo
13 default get_bar
16 #>>>
17 get_foo { #<<<
18 Back start
19 Next get_bar
21 #>>>
22 get_bar { #<<<
23 Back {
24 {$dat(usefoo)} get_foo
25 default start
27 Next review
29 #>>>
30 review { #<<<
31 Back get_bar
32 Finish {}
34 #>>>
35 } -pages {
36 start { #<<<
37 type form
38 schema {
39 _layout {row_args_sticky -resize none}
40 _layout {col_args_sticky -resize none}
41 "Foo?" {usefoo radiogroup -choices {
42 "Use Foo" 1
43 "Don't Use foo" 0
47 _validation_not_blank {
48 "%1 must be filled in"
49 "Foo?" usefoo
53 #>>>
54 get_foo { #<<<
55 type form
56 schema {
57 _layout {row_args_sticky -resize none}
58 _layout {col_args_sticky -resize none}
59 "Foo" {foo entry}
61 _validation_not_blank {
62 "%1 must be filled in"
63 "Foo" foo
67 #>>>
68 get_bar { #<<<
69 type form
70 schema {
71 _layout {row_args_sticky -resize none}
72 _layout {col_args_sticky -resize none}
73 "Foo" {foo label}
74 "Bar" {bar entry}
76 _validation_not_blank {
77 "%1 must be filled in"
78 "Bar" bar
81 _validation {
82 {!$dat(usefoo) || [string first $dat(foo) $dat(bar)] > -1}
83 "If use choose to use foo, bar must contain it"
84 {bar}
88 #>>>
89 review { #<<<
90 type form
91 schema {
92 _layout {row_args_sticky -resize none}
93 _layout {col_args_sticky -resize none}
94 "Foo" {foo label}
95 "Bar" {bar label}
97 #type html
98 #html {
99 # <table>
100 # <tr><td>Foo</td><td>%foo%</td></tr>
101 # <tr><td>Bar</td><td>%bar%</td></tr>
102 # </table>
105 #>>>
108 blt::table . \
109 .wizard 1,1 -fill both
111 wm geometry . "450x250"
113 .wizard waitfor finished
115 array set dat [.wizard get_data]
116 delete object .wizard
118 puts "Got:"
119 parray dat
121 exit