SR Technology WTK Repo
Check-in [ea0ef51845]
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.
Tcl 2019 Conference, Houston/TX, US, Nov 4-8
Send your abstracts to [email protected]
or submit via the online form by Sep 9.

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:reformat demo to reflect the concept of rendering the page view for MVC style apps
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: ea0ef51845f9a60394c0e2ca37a9ef21be63d455
User & Date: stever 2013-01-18 15:30:03
Context
2013-01-18
16:01
decouple connection code so that WebSockets work without first requiring initial AJAX connection check-in: 02630ca04a user: stever tags: trunk
15:30
reformat demo to reflect the concept of rendering the page view for MVC style apps check-in: ea0ef51845 user: stever tags: trunk
2013-01-17
13:42
clean up debugging lines, reformat code blocks for readability check-in: 4f6fadd830 user: stever tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to demo.tcl.

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
..
73
74
75
76
77
78
79







wtk::wm title . "Feet to Meters"

wtk::grid [wtk::frame .c -padding "3 3 12 12"] -column 0 -row 0 -sticky nwes
wtk::grid columnconfigure .c 0 -weight 1; wtk::grid rowconfigure .c 0 -weight 1
wtk::grid [wtk::button .c.calc -text "Calculate" -radius 7 -bg violet -fg lightgreen -command calculate] -column 0 -row 1 -sticky w
wtk::grid [wtk::entry .c.feet -width 7 -textvariable feet -bg GreenYellow -fg Red] -column 1 -row 1 -sticky we
wtk::grid [wtk::label .c.flbl -text "feet" -bg yellow] -column 2 -row 1 -sticky w
wtk::grid [wtk::label .c.islbl -text "is equivalent to"] -column 0 -row 2 -sticky e
wtk::grid [wtk::label .c.meters -textvariable meters] -column 1 -row 2 -sticky we
wtk::grid [wtk::label .c.mlbl -text "meters"] -column 2 -row 2 -sticky w
foreach w [wtk::winfo children .c] {wtk::grid configure $w -padx 50 -pady 50}; #not working yet

wtk::grid [wtk::text .text -rows 4 -cols 40 -bg GreenYellow -fg Red -textvariable textval] -column 0 -row 2 -sticky ew

wtk::grid [wtk::frame .d -padding "3 3 12 12"] -column 0 -row 3 -sticky nwes
wtk::grid columnconfigure .d 0 -weight 1; wtk::grid rowconfigure .d 0 -weight 1
wtk::grid rowconfigure . 3 -weight 1
wtk::grid [wtk::button .d.ib  -text "" -src /images/logo.png -width 63 -height 63 -command swapimages]  -column 0 -row 0 -sticky e
wtk::grid [wtk::label .d.iblbl -text "<-- Click Me"] -column 1 -row 0 -sticky w
wtk::grid [wtk::combobox .d.cb  -text "ComboBox" -options "zero one two three" -variable textval -command selectimg]  -column 2 -row 0 -sticky w
wtk::grid [wtk::checkbutton .d.ck  -bg violet -fg Red -variable checkval -command docheck] -column 3 -row 0 -sticky w
wtk::grid [wtk::label .d.cklbl  -textvariable ckstatus] -column 4 -row 0 -sticky w
foreach w [wtk::winfo children .d] {wtk::grid configure $w -padx 150 -pady 150}; #not working yet

wtk::focus .c.feet
wtk::bind . <Return> {calculate}
set ::image 0


proc docheck {} {
	if {$::checkval} {
		set ::ckstatus "checked"
	} else {
		set ::ckstatus ""
	}
................................................................................
			.d.ib configure -src /images/rainbow.gif}
		
		three {set ::image 3
			.d.ib configure -src /images/cameralens2.jpg}
		
	}
}






>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<
<
<
<







 







>
>
>
>
>
>
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
..
70
71
72
73
74
75
76
77
78
79
80
81
82
proc render {} {
	wtk::wm title . "Feet to Meters"
	
	wtk::grid [wtk::frame .c -padding "3 3 12 12"] -column 0 -row 0 -sticky nwes
	wtk::grid columnconfigure .c 0 -weight 1; wtk::grid rowconfigure .c 0 -weight 1
	wtk::grid [wtk::button .c.calc -text "Calculate" -radius 7 -bg violet -fg lightgreen -command calculate] -column 0 -row 1 -sticky w
	wtk::grid [wtk::entry .c.feet -width 7 -textvariable feet -bg GreenYellow -fg Red] -column 1 -row 1 -sticky we
	wtk::grid [wtk::label .c.flbl -text "feet" -bg yellow] -column 2 -row 1 -sticky w
	wtk::grid [wtk::label .c.islbl -text "is equivalent to"] -column 0 -row 2 -sticky e
	wtk::grid [wtk::label .c.meters -textvariable meters] -column 1 -row 2 -sticky we
	wtk::grid [wtk::label .c.mlbl -text "meters"] -column 2 -row 2 -sticky w
	foreach w [wtk::winfo children .c] {wtk::grid configure $w -padx 50 -pady 50}; #not working yet
	
	wtk::grid [wtk::text .text -rows 4 -cols 40 -bg GreenYellow -fg Red -textvariable textval] -column 0 -row 2 -sticky ew
	
	wtk::grid [wtk::frame .d -padding "3 3 12 12"] -column 0 -row 3 -sticky nwes
	wtk::grid columnconfigure .d 0 -weight 1; wtk::grid rowconfigure .d 0 -weight 1
	wtk::grid rowconfigure . 3 -weight 1
	wtk::grid [wtk::button .d.ib  -text "" -src /images/logo.png -width 63 -height 63 -command swapimages]  -column 0 -row 0 -sticky e
	wtk::grid [wtk::label .d.iblbl -text "<-- Click Me"] -column 1 -row 0 -sticky w
	wtk::grid [wtk::combobox .d.cb  -text "ComboBox" -options "zero one two three" -variable textval -command selectimg]  -column 2 -row 0 -sticky w
	wtk::grid [wtk::checkbutton .d.ck  -bg violet -fg Red -variable checkval -command docheck] -column 3 -row 0 -sticky w
	wtk::grid [wtk::label .d.cklbl  -textvariable ckstatus] -column 4 -row 0 -sticky w
	foreach w [wtk::winfo children .d] {wtk::grid configure $w -padx 150 -pady 150}; #not working yet
}





proc docheck {} {
	if {$::checkval} {
		set ::ckstatus "checked"
	} else {
		set ::ckstatus ""
	}
................................................................................
			.d.ib configure -src /images/rainbow.gif}
		
		three {set ::image 3
			.d.ib configure -src /images/cameralens2.jpg}
		
	}
}

render
	
wtk::focus .c.feet
wtk::bind . <Return> {calculate}
set ::image 0