2.8 The redo Application


The interface:

In Safe-Tcl, exec commands are not invoked. Only
a new button widget gets created.


The code:


set id 0
entry .entry -width 30 -relief sunken -textvariable cmd
pack .entry -padx 1m -pady 1m
bind .entry  {
        set id [expr $id + 1]
        if {$id > 5} {
                destroy .b[expr $id - 5]
        }
        button .b$id -command "exec <@stdin >@stdout $cmd" \
                        -text $cmd
        pack .b$id -fill x
        .b$id invoke
        .entry delete 0 end
}



Back to Book Examples page

Back to Tcl/Tk page