* [PATCH] git-gui: Error on systems with TK < 8.6.0
@ 2017-03-31 12:54 Peter van der Does
2017-03-31 17:19 ` Junio C Hamano
0 siblings, 1 reply; 2+ messages in thread
From: Peter van der Does @ 2017-03-31 12:54 UTC (permalink / raw)
To: git; +Cc: dshrader, dennis, git, kostix+git
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.
---
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
}
--
2.12.2
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] git-gui: Error on systems with TK < 8.6.0
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
0 siblings, 0 replies; 2+ messages in thread
From: Junio C Hamano @ 2017-03-31 17:19 UTC (permalink / raw)
To: Peter van der Does; +Cc: Pat Thoyts, git, dshrader, dennis, git, kostix+git
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
> }
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2017-03-31 17:19 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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
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).