summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: b5e0963)
raw | patch | inline | side by side (parent: b5e0963)
author | Paul Mackerras <paulus@samba.org> | |
Fri, 26 May 2006 12:34:30 +0000 (22:34 +1000) | ||
committer | Paul Mackerras <paulus@samba.org> | |
Fri, 26 May 2006 12:34:30 +0000 (22:34 +1000) |
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>
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>
gitk | patch | blob | history |
index 45d31127fa46318a4f1c928422c51991d0f509f0..101cf9bd9ff8c3b8180ab50e6ceb4655576f9fbf 100755 (executable)
--- a/gitk
+++ b/gitk
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 {} {
# 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
}
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
}
}