summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorLibravatar Shawn O. Pearce <spearce@spearce.org>2007-09-26 14:05:54 -0400
committerLibravatar Shawn O. Pearce <spearce@spearce.org>2007-09-26 14:06:08 -0400
commit6f2d73ec0cb6d5937bb4a62a222f942e4f886d6e (patch)
tree179c76a119cd1006665c3b47a6f5968904df33ff /lib
parentgit-gui: add a simple msgfmt replacement (diff)
downloadtgif-6f2d73ec0cb6d5937bb4a62a222f942e4f886d6e.tar.xz
git-gui: Don't delete console window namespaces too early
If the console finishes displaying its output and is "done" but needs to draw a scrollbar to show the final output messages it is possible for Tk to delete the window namespace before it does the text widget updates, which means we are unable to add the horizontal or vertical scrollbar to the window when the text widget decides it cannot draw all glyphs on screen. We need to delay deleting the window namespace until we know the window is not going to ever be used again. This occurs if we are done receiving output, the command is successful and the window is closed, or if the window is open and the user chooses to close the window after the command has completed. Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Diffstat (limited to 'lib')
-rw-r--r--lib/console.tcl5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/console.tcl b/lib/console.tcl
index cde9a09268..c0e6fb3cc2 100644
--- a/lib/console.tcl
+++ b/lib/console.tcl
@@ -179,23 +179,26 @@ method insert {txt} {
method done {ok} {
if {$ok} {
if {[winfo exists $w.m.s]} {
+ bind $w.m.s <Destroy> [list delete_this $this]
$w.m.s conf -background green -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
}
+ bind $w.m.s <Destroy> [list delete_this $this]
$w.m.s conf -background red -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} {