home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Dream 46
/
Amiga_Dream_46.iso
/
Linux
/
Magazine
/
Tcltk
/
calc.tcl
next >
Wrap
Text File
|
1997-11-13
|
991b
|
54 lines
proc ExecCommand {} {
global .viewtxt
set calcstring [.viewtxt get "insert linestart" "insert lineend" ]
.viewtxt insert "end" "\n"
.viewtxt insert "end" [expr $calcstring]
.viewtxt tag add result "insert linestart" "insert lineend"
.viewtxt insert "end" "\n"
.viewtxt see end
}
proc ExecCommandKey {} {
global .viewtxt
.viewtxt mark set insert "insert - 1 lines lineend"
set calcstring [.viewtxt get "insert linestart" "insert lineend" ]
.viewtxt insert "end" [expr $calcstring]
.viewtxt mark set insert "insert + 1 lines lineend"
.viewtxt tag add result "insert linestart" "insert lineend"
.viewtxt insert "end" "\n"
.viewtxt see end
}
proc ResetCommand {} {
global .viewtxt
.viewtxt delete 0.0 end
}
proc NegateCommand {} {
global .viewtxt
.viewtxt insert "insert linestart" "-"
.viewtxt mark set insert "insert lineend"
}