threads / patch / 12879

patchtcl/tk8.5: fix changing colors through Edit->Preferences

Subject: [PATCH] tcl/tk8.5: fix changing colors through Edit->Preferences

## tl;dr

3 messages between Mar 26, 2008 and Apr 6, 2008. Diffs are folded; open one to read it.

replies: 2people: 2as markdown or json

Gerrit Pape· Mar 26, 2008, 18:45 UTC · lore

With tcl/tk8.5 the lset command seems to behave differently. When changing the background color through Edit->Preferences, the changes are applied, but new dialogs, such as View->New view... barf with

 Error: unknown color name "{#ffffff}"

Additionally when closing gitk, and starting it up again, a bad value has been saved to ~/.gitk, preventing gitk from running properly; it fails with

 Error in startup script: unknown color name "{#ffffff}"
 ...

This commit changes the color dialogs to not handle variables containing just a single color value as tcl lists, which fixes the issue. Tested with tcl/tk8.4 and 8.5.

Dmitry Potapov reported this problem through
 http://bugs.debian.org/472615
Signed-off-by: Gerrit Pape <pape@smarden.org>
---
 gitk |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
Show changes to gitk +3 −3
diff --git a/gitk b/gitk
index 84ab02e..9a4d9c4 100755
--- a/gitk
+++ b/gitk
@@ -8045,11 +8045,11 @@ proc doprefs {} {
     grid $top.cdisp - -sticky w -pady 10
     label $top.bg -padx 40 -relief sunk -background $bgcolor
     button $top.bgbut -text [mc "Background"] -font optionfont \
-	-command [list choosecolor bgcolor 0 $top.bg background setbg]
+	-command [list choosecolor bgcolor {} $top.bg background setbg]
     grid x $top.bgbut $top.bg -sticky w
     label $top.fg -padx 40 -relief sunk -background $fgcolor
     button $top.fgbut -text [mc "Foreground"] -font optionfont \
-	-command [list choosecolor fgcolor 0 $top.fg foreground setfg]
+	-command [list choosecolor fgcolor {} $top.fg foreground setfg]
     grid x $top.fgbut $top.fg -sticky w
     label $top.diffold -padx 40 -relief sunk -background [lindex $diffcolors 0]
     button $top.diffoldbut -text [mc "Diff: old lines"] -font optionfont \
@@ -8069,7 +8069,7 @@ proc doprefs {} {
     grid x $top.hunksepbut $top.hunksep -sticky w
     label $top.selbgsep -padx 40 -relief sunk -background $selectbgcolor
     button $top.selbgbut -text [mc "Select bg"] -font optionfont \
-	-command [list choosecolor selectbgcolor 0 $top.selbgsep background setselbg]
+	-command [list choosecolor selectbgcolor {} $top.selbgsep background setselbg]
     grid x $top.selbgbut $top.selbgsep -sticky w
 
     label $top.cfont -text [mc "Fonts: press to choose"]
-- 
1.5.4.4
Gerrit Pape· Apr 5, 2008, 16:38 UTC · re: Gerrit Pape · lore

Re: [PATCH] tcl/tk8.5: fix changing colors through Edit->Preferences

On Wed, Mar 26, 2008 at 06:45:26PM +0000, Gerrit Pape wrote:
Show 19 quoted lines
> With tcl/tk8.5 the lset command seems to behave differently.  When
> changing the background color through Edit->Preferences, the changes
> are applied, but new dialogs, such as View->New view... barf with
> 
>  Error: unknown color name "{#ffffff}"
> 
> Additionally when closing gitk, and starting it up again, a bad value
> has been saved to ~/.gitk, preventing gitk from running properly; it
> fails with
> 
>  Error in startup script: unknown color name "{#ffffff}"
>  ...
> 
> This commit changes the color dialogs to not handle variables containing
> just a single color value as tcl lists, which fixes the issue.  Tested
> with tcl/tk8.4 and 8.5.
> 
> Dmitry Potapov reported this problem through
>  http://bugs.debian.org/472615

Hi, any comments on this patch? I can reproduce the problem on Debian with tcl/tk 8.5.1 and git 1.5.5.rc3.

Thanks, Gerrit.
Paul Mackerras· Apr 6, 2008, 03:09 UTC · re: Gerrit Pape · lore

Re: [PATCH] tcl/tk8.5: fix changing colors through Edit->Preferences

Gerrit Pape writes:
> Hi, any comments on this patch?  I can reproduce the problem on Debian
> with tcl/tk 8.5.1 and git 1.5.5.rc3.
Thanks for reminding me.  I have applied it.
Paul.

← back to recent threads