-justify left \
-font font_uibold
text $w_t \
- -background white -borderwidth 1 \
+ -background white \
+ -foreground black \
+ -borderwidth 1 \
-relief sunken \
-width 80 -height 10 \
-wrap none \
} else {
$w_t delete $console_cr end
$w_t insert end "\n"
- $w_t insert end [string range $buf $c $cr]
+ $w_t insert end [string range $buf $c [expr {$cr - 1}]]
set c $cr
incr c
}
method done {ok} {
if {$ok} {
if {[winfo exists $w.m.s]} {
- $w.m.s conf -background green -text [mc "Success"]
+ bind $w.m.s <Destroy> [list delete_this $this]
+ $w.m.s conf -background green -foreground black \
+ -text [mc "Success"]
if {$is_toplevel} {
$w.ok conf -state normal
focus $w.ok
}
+ } else {
+ delete_this
}
} else {
if {![winfo exists $w.m.s]} {
_init $this
}
- $w.m.s conf -background red -text [mc "Error: Command Failed"]
+ bind $w.m.s <Destroy> [list delete_this $this]
+ $w.m.s conf -background red -foreground black \
+ -text [mc "Error: Command Failed"]
if {$is_toplevel} {
$w.ok conf -state normal
focus $w.ok
}
}
- delete_this
}
method _sb_set {sb orient first last} {
- if {$first == 0 && $last == 1} {
- if {[winfo exists $sb]} {
- destroy $sb
- }
- return
- }
-
if {![winfo exists $sb]} {
+ if {$first == $last || ($first == 0 && $last == 1)} return
if {$orient eq {h}} {
scrollbar $sb -orient h -command [list $w_t xview]
pack $sb -fill x -side bottom -before $w_t
pack $sb -fill y -side right -before $w_t
}
}
- catch {$sb set $first $last}
+ $sb set $first $last
}
}