cols 80
debugPrompt {(level \#$level) debug [history nextid] > }
dead {}
+ edit edit
expandorder {Pathname Variable Procname}
font {}
history 48
errorInfo {}
protocol exit
showOnStartup 1
- slavealias { edit more less tkcon }
slaveprocs {
alias clear dir dump echo idebug lremove
tkcon_puts tkcon_gets observe observe_var unalias which what
} {
if {![info exists PRIV($key)]} { set PRIV($key) $default }
}
+ foreach {key default} {
+ slavealias { $OPT(edit) more less tkcon }
+ } {
+ if {![info exists PRIV($key)]} { set PRIV($key) [subst $default] }
+ }
set PRIV(version) $VERSION
if {[info exists PRIV(name)]} {
variable PRIV
set w $PRIV(console)
- ## Remove error tags that no longer span anything
- ## Make sure the tag pattern matches the unique tag prefix
- foreach tag [$w tag names] {
- if {[string match _tag* $tag] && ![llength [$w tag ranges $tag]]} {
- $w tag delete $tag
+ if {[winfo exists $w]} {
+ ## Remove error tags that no longer span anything
+ ## Make sure the tag pattern matches the unique tag prefix
+ foreach tag [$w tag names] {
+ if {[string match _tag* $tag] && ![llength [$w tag ranges $tag]]} {
+ $w tag delete $tag
+ }
}
}
if {$OPT(gc-delay)} {
}
}
AddSlaveHistory $cmd
+ catch {EvalAttached [list set {} $res]}
if {$code} {
if {$OPT(hoterrors)} {
set tag [UniqueTag $w]
[list $w tag configure $tag -under 0]
$w tag bind $tag <ButtonRelease-1> \
"if {!\[info exists tkPriv(mouseMoved)\] || !\$tkPriv(mouseMoved)} \
- {[list edit -attach [Attach] -type error -- $PRIV(errorInfo)]}"
+ {[list $OPT(edit) -attach [Attach] -type error -- $PRIV(errorInfo)]}"
} else {
$w insert output $res\n stderr
}
## Interpreter disappeared
if {[string compare leave $OPT(dead)] && \
([string match ignore $OPT(dead)] || \
- [tk_dialog $PRIV(base).dead "Dead Attachment" \
- "\"$PRIV(app)\" appears to have died.\
- \nReturn to primary slave interpreter?" questhead 0 OK No])} {
+ [tk_messageBox -title "Dead Attachment" -type yesno \
+ -icon info -message \
+ "\"$PRIV(app)\" appears to have died.\
+ \nReturn to primary slave interpreter?"]=="no")} {
set PRIV(appname) "DEAD:$PRIV(appname)"
set PRIV(deadapp) 1
} else {
$w tag bind $tag <Enter> [list $w tag configure $tag -under 1]
$w tag bind $tag <Leave> [list $w tag configure $tag -under 0]
$w tag bind $tag <ButtonRelease-1> "if {!\$tkPriv(mouseMoved)} \
- {[list edit -attach $app -type proc -find $what -- $cmd]}"
+ {[list $OPT(edit) -attach $app -type proc -find $what -- $cmd]}"
}
set info [string range $info $c1 end]
set start [$w index $start+${c1}c]
$w tag bind $tag <Enter> [list $w tag configure $tag -under 1]
$w tag bind $tag <Leave> [list $w tag configure $tag -under 0]
$w tag bind $tag <ButtonRelease-1> "if {!\$tkPriv(mouseMoved)} \
- {[list edit -attach $app -type proc -- $cmd]}"
+ {[list $OPT(edit) -attach $app -type proc -- $cmd]}"
}
}
}
}
if {[string match {} $info]} { set info "errorInfo empty" }
## If args is empty, the -attach switch just ignores it
- edit -attach $args -type error -- $info
+ $OPT(edit) -attach $args -type error -- $info
}
fi* {
## 'find' string
append w $i
toplevel $w
wm withdraw $w
- if {[string length $word] > 12} {
- wm title $w "tkcon Edit: [string range $word 0 9]..."
+ if {[string length $word] > 20} {
+ wm title $w "[string range $word 0 16]... - tkcon Edit"
} else {
- wm title $w "tkcon Edit: $word"
+ wm title $w "$word - tkcon Edit"
}
text $w.text -wrap none \
set app [Attach]
if {[lsearch $type proc] != -1} {
$PRIV(context) add command -label "View Procedure" \
- -command [list edit -attach $app -type proc -- $word]
+ -command [list $OPT(edit) -attach $app -type proc -- $word]
}
if {[lsearch $type var] != -1} {
$PRIV(context) add command -label "View Variable" \
- -command [list edit -attach $app -type var -- $word]
+ -command [list $OPT(edit) -attach $app -type var -- $word]
}
if {[lsearch $type file] != -1} {
$PRIV(context) add command -label "View File" \
- -command [list edit -attach $app -type file -- $word]
+ -command [list $OPT(edit) -attach $app -type file -- $word]
}
tk_popup $PRIV(context) $X $Y
}