gitk: Fix changing colors through Edit->Preferences
authorGerrit Pape <pape@smarden.org>
Wed, 26 Mar 2008 18:45:26 +0000 (18:45 +0000)
committerPaul Mackerras <paulus@samba.org>
Sun, 6 Apr 2008 03:07:27 +0000 (13:07 +1000)
commit80dd7b44970dee7d82fa735d2e0b828051f80545
tree76caab3c09aefe7e73dc100392a06b71011e4fd2
parent2708d9df59e45bd74bfb71027e1ea7c54a9eecd5
gitk: Fix changing colors through Edit->Preferences

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 fixes the problem by changing the color dialogs to pass
the empty string {} as the list index to choosecolor.  This causes
the lset and lindex commands used by choosecolor to use and set the
whole variable (bgcolor, fgcolor or selectbgcolor) rather than
treating them as a 1-element list.  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>
Signed-off-by: Paul Mackerras <paulus@samba.org>
gitk