+2002-02-22 Jeff Hobbs <jeffh@ActiveState.com>
+
+ * tkcon.tcl (AddSlaveHistory): changed history to not add the
+ command if it is the same as the previous command (it will still
+ be evaluated). (soderstrom)
+ Added panedwindow and labelframe as recognized Tk commands.
+
2002-01-24 Jeff Hobbs <jeffh@ActiveState.com>
**** TKCON 2.3 RELEASE ****
$w insert output $cmd\n stdin
}
} elseif {$OPT(calcmode) && ![catch {expr $cmd} err]} {
- EvalSlave history add $cmd
+ AddSlaveHistory $cmd
set cmd $err
set code -1
}
}
}
}
- EvalSlave history add $cmd
+ AddSlaveHistory $cmd
if {$code} {
if {$OPT(hoterrors)} {
set tag [UniqueTag $w]
}
}
+## ::tkcon::AddSlaveHistory -
+## Command is added to history only if different from previous command.
+## This also doesn't cause the history id to be incremented, although the
+## command will be evaluated.
+# ARGS: cmd - command to add
+##
+proc ::tkcon::AddSlaveHistory cmd {
+ set ev [EvalSlave history nextid]
+ incr ev -1
+ set code [catch {EvalSlave history event $ev} lastCmd]
+ if {$code || [string compare $cmd $lastCmd]} {
+ EvalSlave history add $cmd
+ }
+}
+
## ::tkcon::EvalSend - sends the args to the attached interpreter
## Varies from 'send' by determining whether attachment is dead
## when an error is received
lappend tkcmds bell bind bindtags button \
canvas checkbutton clipboard destroy \
entry event focus font frame grab grid image \
- label listbox lower menu menubutton message \
- option pack place radiobutton raise \
+ label labelframe listbox lower menu menubutton message \
+ option pack panedwindow place radiobutton raise \
scale scrollbar selection send spinbox \
text tk tkwait toplevel winfo wm
if {[lsearch -exact $tkcmds $name] >= 0 && \