diff options
author | Paul Mackerras <paulus@samba.org> | 2006-05-26 22:34:30 +1000 |
---|---|---|
committer | Paul Mackerras <paulus@samba.org> | 2006-05-26 22:34:30 +1000 |
commit | e54be9e30ffb8ab21fe9ef740991940f4d00e79c (patch) | |
tree | 9b2091882f9ca3ead2775021fef97c6e5c68a22c /gitk | |
parent | b5e096337c5516fece2c21d813c8534ac541f2a0 (diff) | |
download | git-e54be9e30ffb8ab21fe9ef740991940f4d00e79c.tar.gz git-e54be9e30ffb8ab21fe9ef740991940f4d00e79c.tar.xz |
gitk: show_error fix
Bug noted by Junio C Hamano: show_error can be passed "." (root
window) as its $w argument, but appending ".m" and ".ok" results in
creating "..m" and "..ok" as window paths, which were invalid.
This fixes it in a slightly different way from Junio's patch, though.
Signed-off-by: Paul Mackerras <paulus@samba.org>
Diffstat (limited to 'gitk')
-rwxr-xr-x | gitk | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -357,21 +357,21 @@ proc readrefs {} { close $refd } -proc show_error {w msg} { +proc show_error {w top msg} { message $w.m -text $msg -justify center -aspect 400 pack $w.m -side top -fill x -padx 20 -pady 20 - button $w.ok -text OK -command "destroy $w" + button $w.ok -text OK -command "destroy $top" pack $w.ok -side bottom -fill x - bind $w <Visibility> "grab $w; focus $w" - bind $w <Key-Return> "destroy $w" - tkwait window $w + bind $top <Visibility> "grab $top; focus $top" + bind $top <Key-Return> "destroy $top" + tkwait window $top } proc error_popup msg { set w .error toplevel $w wm transient $w . - show_error $w $msg + show_error $w $w $msg } proc makewindow {} { @@ -4917,7 +4917,7 @@ foreach arg $argv { # check that we can find a .git directory somewhere... set gitdir [gitdir] if {![file isdirectory $gitdir]} { - show_error . "Cannot find the git directory \"$gitdir\"." + show_error {} . "Cannot find the git directory \"$gitdir\"." exit 1 } @@ -4939,7 +4939,7 @@ if {$i >= 0} { if {$i > 0} { set err [string range $err [expr {$i + 6}] end] } - show_error . "Bad arguments to gitk:\n$err" + show_error {} . "Bad arguments to gitk:\n$err" exit 1 } } |