git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: gitk: set uicolor SystemButtonFace error on X11 if .gitk created using Win32 tk

From
Erik Faye-Lund <kusmabite@gmail.com>
Date
Feb 23, 2012, 14:03 UTC
Message-ID
<CABPQNSZqX0_YAn=mOpuRquG9OzFgwS9fQ6=YXqULxMz-hbH6Zw@mail.gmail.com>
In-Reply-To
<70952A932255A2489522275A628B97C31288FA0B@xmb-sjc-233.amer.cisco.com>

On Wed, Feb 22, 2012 at 11:13 PM, Matt Seitz (matseitz) <matseitz@cisco.com> wrote:

Show 15 quoted lines
> Would you please change gitk to not hard-code Win32-specific color
> values when creating .gitk on a Win32 windowing system?
>
> Gitk stopped working for me on Cygwin when Cygwin changed from using a
> Win32 native version of tk to using the standard X11 version.  The error
> was because gitk had previously created a .gitk file using Win32
> specific color values:
>
> https://github.com/gitster/git/commit/1924d1bc0dc99cd3460d3551671908cc76
> c09d3b
>
> I was able to work around the problem by replacing the Win32 specific
> colors in my .gitk file with the default colors gitk uses on other
> windowing systems.
>

Are you saying that the tk shipped with recent Cygwin reports "win32" for "[tk windowingsystem]", but does not recognize the "SystemButtonFace" etc values?

If so, perhaps adding a check for one of the constant values might make sense. But I'd expect "[tk windowingsystem]" to report "x11" if it's simply a Cygwin build of the X11-version as you say...

Anyway, this does sound like a regression in Cygwin; we're probably not the only ones to use "SystemButtonFace" etc after consulting "[tk windowingsystem]"...

Hm, no wait, the documentation seems to suggest ditching the System-prefix to these constants: http://www.tcl.tk/man/tcl/TkCmd/colors.htm

Does this patch help?
---
diff --git a/gitk-git/gitk b/gitk-git/gitk
index f9e936d..7e9a01f 100755
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -11559,10 +11559,10 @@ if {[tk windowingsystem] eq "aqua"} {

 set colors {green red blue magenta darkgrey brown orange}
 if {[tk windowingsystem] eq "win32"} {
-    set uicolor SystemButtonFace
-    set bgcolor SystemWindow
-    set fgcolor SystemButtonText
-    set selectbgcolor SystemHighlight
+    set uicolor ButtonFace
+    set bgcolor Window
+    set fgcolor ButtonText
+    set selectbgcolor Highlight
 } else {
     set uicolor grey85
     set bgcolor white
Previous: Matt Seitz (matseitz)Next: Matt Seitz (matseitz)
Message 2 of 3 in “gitk: set uicolor SystemButtonFace error on X11 if .gitk created using Win32 tk”
  1. Matt Seitz (matseitz)Feb 22, 2012
  2. Erik Faye-LundFeb 23, 2012
  3. Matt Seitz (matseitz)Feb 23, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.