git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Marcus Karlsson <mk@acc.umu.se>
To: Paul Mackerras <paulus@samba.org>
Cc: git@vger.kernel.org, Marcus Karlsson <mk@acc.umu.se>
Subject: [PATCH] gitk: Fix crash when not using themed widgets
Date: Sun,  7 Oct 2012 23:21:14 +0200	[thread overview]
Message-ID: <1349644874-22988-1-git-send-email-mk@acc.umu.se> (raw)

When configured not to use themed widgets gitk may crash on launch with
a message that says that the image "bm-left disabled bm-left-gray"
doesn't exist. This happens when the left and right arrow buttons are
created.

The crash can be avoided by configuring the buttons differently
depending on whether or not themed widgets are used. If themed widgets
are not used then only set the images to bm-left and bm-right
respectively, and keep the old behavior when themed widgets are used.

The previous behaviour was added in f062e50f to work around a bug in Tk
on OS X where the disabled state did not display properly. The buttons
may still not display correctly, however the workaround added in
f062e50f will still apply if gitk is used with themed widgets.

Make gitk not crash on launch when not using themed widgets.

Signed-off-by: Marcus Karlsson <mk@acc.umu.se>
---
 gitk |   16 ++++++++++++----
 1 file changed, 12 insertions(+), 4 deletions(-)

diff --git a/gitk b/gitk
index 379582a..02ffd9b 100755
--- a/gitk
+++ b/gitk
@@ -2182,11 +2182,19 @@ proc makewindow {} {
     image create bitmap bm-right -data $bm_right_data
     image create bitmap bm-right-gray -data $bm_right_data -foreground "#999"
 
-    ${NS}::button .tf.bar.leftbut -image [list bm-left disabled bm-left-gray] \
-	-command goback -state disabled -width 26
+    ${NS}::button .tf.bar.leftbut -command goback -state disabled -width 26
+    if {$use_ttk} {
+	.tf.bar.leftbut configure -image [list bm-left disabled bm-left-gray]
+    } else {
+	.tf.bar.leftbut configure -image bm-left
+    }
     pack .tf.bar.leftbut -side left -fill y
-    ${NS}::button .tf.bar.rightbut -image [list bm-right disabled bm-right-gray] \
-	-command goforw -state disabled -width 26
+    ${NS}::button .tf.bar.rightbut -command goforw -state disabled -width 26
+    if {$use_ttk} {
+	.tf.bar.rightbut configure -image [list bm-right disabled bm-right-gray]
+    } else {
+	.tf.bar.rightbut configure -image bm-right
+    }
     pack .tf.bar.rightbut -side left -fill y
 
     ${NS}::label .tf.bar.rowlabel -text [mc "Row"]
-- 
1.7.10.4

             reply	other threads:[~2012-10-07 21:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-07 21:21 Marcus Karlsson [this message]
2012-10-21 22:22 ` [PATCH] gitk: Fix crash when not using themed widgets Paul Mackerras

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1349644874-22988-1-git-send-email-mk@acc.umu.se \
    --to=mk@acc.umu.se \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).