zymosis: MEMPTR fix for `CPxR` and `IN A,(port)`
[zymosis.git] / tcl / wintest0.tcl
blob8061e42b0d98a943b612d3eecf74c9b36167db87
1 set win_x 0
2 set win_y 0
4 proc nw {} {
5 set win [winsys window "red" "win0" $::win_x $::win_y 180 120 "title"]
6 puts "win=$win"
8 set ok [$win button "ok" 2 $([$win geth]-9-12) -1 -1 "O&K" [lambda {me} {
9 set win [$me window]
10 puts "=== OK ==="
11 puts [$me type]
12 puts [$win type]
14 puts -nonewline "cb1: "
15 puts [[$win "cb1"] getstate]
17 puts -nonewline "cb2: "
18 puts [[$win "cb2"] getstate]
20 puts -nonewline "radiogroup 'rgroup1': "
21 puts [$win getradioactive "rgroup1"]
23 puts -nonewline "rb1 group: "
24 puts [[$win "g1r1"] getgroup]
26 puts -nonewline "rb1: "
27 puts [[$win "g1r1"] getradioactive]
29 puts -nonewline "rb2: "
30 puts [[$win "g1r2"] getradioactive]
32 puts -nonewline "edt: \["
33 puts -nonewline [[$win "led0"] gettext]
34 puts "\]"
35 }]]
36 $ok setdefault
37 $ok activate
39 set cancel [$win button "cancel" $([$ok getx]+[$ok getw]+2) [$ok gety] -1 -1 "Cancel" [lambda {me} {
40 #puts [winsys type $me]
41 puts "Cancel"
42 [$me window] close
43 }]]
44 $cancel setcancel
46 set st [$win static "static_name" 2 2 -1 -1 "&name:"]
48 set le [$win lineedit "led0" $([$st getx]+[$st getw]+2) [$st gety] 60 -1 "text"]
49 $st setlinked $le
51 set cb1 [$win checkbox "cb1" [$st getx] $([$st gety]+[$st geth]+1) -1 -1 "checkbox &1"]
52 $cb1 setstate 1
54 set cb2 [$win checkbox "cb2" [$cb1 getx] $([$cb1 gety]+[$cb1 geth]+1) -1 -1 "checkbox &2"]
55 $cb2 setstate 2
57 set rb1 [$win radio "rgroup1" "g1r1" $([$cb2 getx]+4) $([$cb2 gety]+[$cb2 geth]+12) -1 -1 "r&adio 1"]
59 set rb2 [$win radio "rgroup1" "g1r2" [$rb1 getx] $([$rb1 gety]+[$rb1 geth]+1) -1 -1 "ra&dio 2"]
60 $rb2 setradioactive
62 set frm [$win frame "frm" $([$rb1 getx]-3) $([$rb1 gety]-9) 61 31 "frame"]
64 set hsb [$win scrollbar horiz "hsb" [$rb1 getx] $([$frm gety]+[$frm geth]+4) 64]
66 set vsb [$win scrollbar vert "vsb" $([$hsb getx]+[$hsb getw]+4) $([$hsb gety]-32) 60]
67 $vsb setmax 32
69 set lsb [$win listbox "lsb" 100 10 60 90]
70 $lsb setvbar 1
71 $lsb setmulti 1
73 loop ic 0 22 {
74 $lsb additem "item $ic"
77 set ::win_x $($::win_x + 16)
78 set ::win_y $($::win_y + 16)
79 if {$::win_x > 300} { set ::win_x 1 }
80 if {$::win_y > 220} { set ::win_y 1 }
82 set ::win0 $win
85 proc cw {} {
86 $::win0 close
87 unset ::win0