git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Peter van der Does <peter@avirtualhome.com>
Cc: Pat Thoyts <patthoyts@users.sourceforge.net>,
	git@vger.kernel.org, dshrader@lanl.gov, dennis@kaarsemaker.net,
	git@jessiehernandez.com, kostix+git@007spb.ru
Subject: Re: [PATCH] git-gui: Error on systems with TK < 8.6.0
Date: Fri, 31 Mar 2017 10:19:03 -0700	[thread overview]
Message-ID: <xmqqlgrlz7nc.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <c56892f3-602c-d684-5d07-a3ce3bab8189@avirtualhome.com> (Peter van der Does's message of "Fri, 31 Mar 2017 08:54:23 -0400")

Peter van der Does <peter@avirtualhome.com> writes:

> 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.

>  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
>  			}

      reply	other threads:[~2017-03-31 17:19 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-31 12:54 [PATCH] git-gui: Error on systems with TK < 8.6.0 Peter van der Does
2017-03-31 17:19 ` Junio C Hamano [this message]

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=xmqqlgrlz7nc.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=dennis@kaarsemaker.net \
    --cc=dshrader@lanl.gov \
    --cc=git@jessiehernandez.com \
    --cc=git@vger.kernel.org \
    --cc=kostix+git@007spb.ru \
    --cc=patthoyts@users.sourceforge.net \
    --cc=peter@avirtualhome.com \
    /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).