This is the mail archive of the
insight@sourceware.org
mailing list for the Insight project.
-initialcolor black bug in Insight Tk color picker
- From: Lloyd Wood <L dot Wood at surrey dot ac dot uk>
- To: insight at sourceware dot org
- Date: Mon, 09 Oct 2006 17:27:39 +0100
- Subject: -initialcolor black bug in Insight Tk color picker
- Authentication-results: rtp-dkim-1.cisco.com; header.From=L.Wood@surrey.ac.uk; dkim=neutral
Hi,
I've written code that exercises the Tk color picker in Insight Tcl/Tk under Cygwin. However, the picker does not always work as I would expect.
When -initialcolor is set to black or #000000 (#000) behaviour of the color picker is unexpected. Clicking on a color from the selector box does not update the color/solid square at bottom to match the selected color, unless the user also moves the black/white slider at right.
Sample code for wish showing this behaviour is below. The color/solid box stays black unless you also move the vertical slider.
#!/usr/bin/wish
set startcolor #000000
set color [tk_chooseColor -initialcolor $startcolor \
-title "testing setting color"]
if {($color == "") } {
puts "cancelled"
return
}
puts $color
starting with
set color black
or
set color #000
or even
set color \#000
shows the same behaviour. I've tried the 0x000000 hex notation you would expect for setting a hex value, but that gets me a complaint about an unknown colour. If I say e.g.
set startcolor yellow
the color/solid box works and is updated just as you would expect.
Why is only black/zero special here? It should be just another colour.
thanks,
L.
<http://www.ee.surrey.ac.uk/Personal/L.Wood<L.Wood@surrey.ac.uk