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

Re: [PATCH] git-gui: Error on systems with TK < 8.6.0

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 31, 2017, 17:19 UTC
Message-ID
<xmqqlgrlz7nc.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<c56892f3-602c-d684-5d07-a3ce3bab8189@avirtualhome.com>
Peter van der Does <peter@avirtualhome.com> writes:
Show 6 quoted lines
> Using git-gui on systems that run a TK version below 8.6.0 results in a
> crash when checking for the current theme.
>
> Catch the error on those systems and use a different command to check
> for the current theme.
> ---

Needs sign-off. Also if you can make the patch against the git-gui project (the upstream project for this part of our tree, which has this file at lib/themed.tcl, not at git-gui/lib/themed.tcl) and send it to its maintainer (Cc'ed), it would be great.

Thanks.
Show 20 quoted lines
>  git-gui/lib/themed.tcl | 6 +++++-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/git-gui/lib/themed.tcl b/git-gui/lib/themed.tcl
> index 351a712c8..bb4e8f25e 100644
> --- a/git-gui/lib/themed.tcl
> +++ b/git-gui/lib/themed.tcl
> @@ -248,7 +248,11 @@ proc tspinbox {w args} {
>  proc ttext {w args} {
>  	global use_ttk
>  	if {$use_ttk} {
> -		switch -- [ttk::style theme use] {
> +		# Handle either current Tk or older versions of 8.5
> +		if {[catch {set theme [ttk::style theme use]}]} {
> +			set theme  $::ttk::currentTheme
> +		}
> +		switch -- $theme {
>  			"vista" - "xpnative" {
>  				lappend args -highlightthickness 0 -borderwidth 0
>  			}
Previous: Peter van der Does
Message 2 of 2 in “git-gui: Error on systems with TK < 8.6.0”
  1. git-gui: Error on systems with TK < 8.6.0Peter van der Does, Mar 31, 2017
  2. Junio C HamanoMar 31, 2017

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.