{"thread":{"id":"29699","subject":"gitk: set uicolor SystemButtonFace error on X11 if .gitk created using Win32 tk","startedAt":"2012-02-22T22:13:23Z","lastAt":"2012-02-23T19:20:13Z","messageCount":3,"participants":["Matt Seitz (matseitz)","Erik Faye-Lund"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"185213","messageId":"70952A932255A2489522275A628B97C31288FA0B@xmb-sjc-233.amer.cisco.com","threadId":"29699","inReplyTo":null,"subject":"gitk: set uicolor SystemButtonFace error on X11 if .gitk created using Win32 tk","fromName":"Matt Seitz (matseitz)","fromEmail":"matseitz@cisco.com","sentAt":"2012-02-22T22:13:23Z","receivedAt":"2012-02-22T22:13:23Z","isPatch":false,"sender":{"key":"matseitz@cisco.com","avatar":null},"body":"Would you please change gitk to not hard-code Win32-specific color\nvalues when creating .gitk on a Win32 windowing system?\n\nGitk stopped working for me on Cygwin when Cygwin changed from using a\nWin32 native version of tk to using the standard X11 version.  The error\nwas because gitk had previously created a .gitk file using Win32\nspecific color values:\n\nhttps://github.com/gitster/git/commit/1924d1bc0dc99cd3460d3551671908cc76\nc09d3b\n\nI was able to work around the problem by replacing the Win32 specific\ncolors in my .gitk file with the default colors gitk uses on other\nwindowing systems.\n \nSee also:\n\nhttp://cygwin.com/ml/cygwin/2012-02/msg00391.html\n"},{"id":"185276","messageId":"CABPQNSZqX0_YAn=mOpuRquG9OzFgwS9fQ6=YXqULxMz-hbH6Zw@mail.gmail.com","threadId":"29699","inReplyTo":"70952A932255A2489522275A628B97C31288FA0B@xmb-sjc-233.amer.cisco.com","subject":"Re: gitk: set uicolor SystemButtonFace error on X11 if .gitk created using Win32 tk","fromName":"Erik Faye-Lund","fromEmail":"kusmabite@gmail.com","sentAt":"2012-02-23T14:03:12Z","receivedAt":"2012-02-23T14:03:12Z","isPatch":false,"sender":{"key":"kusmabite@gmail.com","avatar":"https://avatars.githubusercontent.com/u/47073?v=4"},"body":"On Wed, Feb 22, 2012 at 11:13 PM, Matt Seitz (matseitz)\n<matseitz@cisco.com> wrote:\n> Would you please change gitk to not hard-code Win32-specific color\n> values when creating .gitk on a Win32 windowing system?\n>\n> Gitk stopped working for me on Cygwin when Cygwin changed from using a\n> Win32 native version of tk to using the standard X11 version.  The error\n> was because gitk had previously created a .gitk file using Win32\n> specific color values:\n>\n> https://github.com/gitster/git/commit/1924d1bc0dc99cd3460d3551671908cc76\n> c09d3b\n>\n> I was able to work around the problem by replacing the Win32 specific\n> colors in my .gitk file with the default colors gitk uses on other\n> windowing systems.\n>\n\nAre you saying that the tk shipped with recent Cygwin reports \"win32\"\nfor \"[tk windowingsystem]\", but does not recognize the\n\"SystemButtonFace\" etc values?\n\nIf so, perhaps adding a check for one of the constant values might\nmake sense. But I'd expect \"[tk windowingsystem]\" to report \"x11\" if\nit's simply a Cygwin build of the X11-version as you say...\n\nAnyway, this does sound like a regression in Cygwin; we're probably\nnot the only ones to use \"SystemButtonFace\" etc after consulting \"[tk\nwindowingsystem]\"...\n\nHm, no wait, the documentation seems to suggest ditching the\nSystem-prefix to these constants:\nhttp://www.tcl.tk/man/tcl/TkCmd/colors.htm\n\nDoes this patch help?\n\n---\n\ndiff --git a/gitk-git/gitk b/gitk-git/gitk\nindex f9e936d..7e9a01f 100755\n--- a/gitk-git/gitk\n+++ b/gitk-git/gitk\n@@ -11559,10 +11559,10 @@ if {[tk windowingsystem] eq \"aqua\"} {\n\n set colors {green red blue magenta darkgrey brown orange}\n if {[tk windowingsystem] eq \"win32\"} {\n-    set uicolor SystemButtonFace\n-    set bgcolor SystemWindow\n-    set fgcolor SystemButtonText\n-    set selectbgcolor SystemHighlight\n+    set uicolor ButtonFace\n+    set bgcolor Window\n+    set fgcolor ButtonText\n+    set selectbgcolor Highlight\n } else {\n     set uicolor grey85\n     set bgcolor white\n"},{"id":"185290","messageId":"70952A932255A2489522275A628B97C31294E764@xmb-sjc-233.amer.cisco.com","threadId":"29699","inReplyTo":"CABPQNSZqX0_YAn=mOpuRquG9OzFgwS9fQ6=YXqULxMz-hbH6Zw@mail.gmail.com","subject":"RE: gitk: set uicolor SystemButtonFace error on X11 if .gitk created using Win32 tk","fromName":"Matt Seitz (matseitz)","fromEmail":"matseitz@cisco.com","sentAt":"2012-02-23T19:20:13Z","receivedAt":"2012-02-23T19:20:13Z","isPatch":false,"sender":{"key":"matseitz@cisco.com","avatar":null},"body":"> From: Erik Faye-Lund [mailto:kusmabite@gmail.com]\n> \n> Are you saying that the tk shipped with recent Cygwin reports \"win32\"\n> for \"[tk windowingsystem]\", but does not recognize the\n> \"SystemButtonFace\" etc values?\n\nHere is what I am saying:\n\n1.  Cygwin tk 8.4.x and earlier:\n-Reports \"win32\" for \"[tk windowingsystem]\"\n-Recognizes the \"SystemButtonFace\" etc values\n\n2.  Cygwin tk 8.5.11:\n-Reports \"x11\" for \"[tk windowingsystem]\"\n-Does not recognize the \"SystemButtonFace\" etc values\n\n> Does this patch help?\n\nNo, this has the same problem: if gitk is installed using a tk that\nreports \"win32\" for \"[tk windowingsystem]\", then gitk hard codes win32\nspecific values into .gitk.  If the user later changes to a tk that\ndoesn't support win32 specific values, gitk will no longer work.\n\nTwo use cases:  \n\n1.  My situation:  User replaces a win32 tk with an x11 tk\n2.  User uses a common .gitk file when running Windows and Linux.\n\nHere's the error:\n$ uname -a\nCYGWIN_NT-5.1 matseitz-wxp 1.7.10(0.259/5/3) 2012-02-05 12:36 i686\nCygwin\n$ wish\n% tk windowingsystem\nx11\n% exit\n$ gitk &\n[1] 6312\n$ Error in startup script: unknown color name \"ButtonFace\"\n    while executing\n\"winfo rgb . $c\"\n    (procedure \"setui\" line 3)\n    invoked from within\n\"setui $uicolor\"\n    (file \"/usr/bin/gitk\" line 11522)\n"}]}