{"thread":{"id":"45563","subject":"[PATCH] git-gui: Error on systems with TK < 8.6.0","startedAt":"2017-03-31T12:54:31Z","lastAt":"2017-03-31T17:19:10Z","messageCount":2,"participants":["Peter van der Does","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"315882","messageId":"c56892f3-602c-d684-5d07-a3ce3bab8189@avirtualhome.com","threadId":"45563","inReplyTo":null,"subject":"[PATCH] git-gui: Error on systems with TK < 8.6.0","fromName":"Peter van der Does","fromEmail":"peter@avirtualhome.com","sentAt":"2017-03-31T12:54:23Z","receivedAt":"2017-03-31T12:54:31Z","isPatch":true,"sender":{"key":"peter@avirtualhome.com","avatar":"https://avatars.githubusercontent.com/u/380071?v=4"},"body":"Using git-gui on systems that run a TK version below 8.6.0 results in a\ncrash when checking for the current theme.\n\nCatch the error on those systems and use a different command to check\nfor the current theme.\n---\n git-gui/lib/themed.tcl | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/git-gui/lib/themed.tcl b/git-gui/lib/themed.tcl\nindex 351a712c8..bb4e8f25e 100644\n--- a/git-gui/lib/themed.tcl\n+++ b/git-gui/lib/themed.tcl\n@@ -248,7 +248,11 @@ proc tspinbox {w args} {\n proc ttext {w args} {\n \tglobal use_ttk\n \tif {$use_ttk} {\n-\t\tswitch -- [ttk::style theme use] {\n+\t\t# Handle either current Tk or older versions of 8.5\n+\t\tif {[catch {set theme [ttk::style theme use]}]} {\n+\t\t\tset theme  $::ttk::currentTheme\n+\t\t}\n+\t\tswitch -- $theme {\n \t\t\t\"vista\" - \"xpnative\" {\n \t\t\t\tlappend args -highlightthickness 0 -borderwidth 0\n \t\t\t}\n-- \n2.12.2\n"},{"id":"315928","messageId":"xmqqlgrlz7nc.fsf@gitster.mtv.corp.google.com","threadId":"45563","inReplyTo":"c56892f3-602c-d684-5d07-a3ce3bab8189@avirtualhome.com","subject":"Re: [PATCH] git-gui: Error on systems with TK < 8.6.0","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-03-31T17:19:03Z","receivedAt":"2017-03-31T17:19:10Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Peter van der Does <peter@avirtualhome.com> writes:\n\n> Using git-gui on systems that run a TK version below 8.6.0 results in a\n> crash when checking for the current theme.\n>\n> Catch the error on those systems and use a different command to check\n> for the current theme.\n> ---\n\nNeeds sign-off.  Also if you can make the patch against the git-gui\nproject (the upstream project for this part of our tree, which has\nthis file at lib/themed.tcl, not at git-gui/lib/themed.tcl) and send\nit to its maintainer (Cc'ed), it would be great.\n\nThanks.\n\n>  git-gui/lib/themed.tcl | 6 +++++-\n>  1 file changed, 5 insertions(+), 1 deletion(-)\n>\n> diff --git a/git-gui/lib/themed.tcl b/git-gui/lib/themed.tcl\n> index 351a712c8..bb4e8f25e 100644\n> --- a/git-gui/lib/themed.tcl\n> +++ b/git-gui/lib/themed.tcl\n> @@ -248,7 +248,11 @@ proc tspinbox {w args} {\n>  proc ttext {w args} {\n>  \tglobal use_ttk\n>  \tif {$use_ttk} {\n> -\t\tswitch -- [ttk::style theme use] {\n> +\t\t# Handle either current Tk or older versions of 8.5\n> +\t\tif {[catch {set theme [ttk::style theme use]}]} {\n> +\t\t\tset theme  $::ttk::currentTheme\n> +\t\t}\n> +\t\tswitch -- $theme {\n>  \t\t\t\"vista\" - \"xpnative\" {\n>  \t\t\t\tlappend args -highlightthickness 0 -borderwidth 0\n>  \t\t\t}\n"}]}