On 1 Aug 2007, at 16:14, Allan Odgaard wrote:
On 1. Aug 2007, at 15:30, Hans-Joerg Bibiko wrote:
[...] I wrote a routine for tm_dialog to parse the result dictionary for NSColor objects. If there are some the routine will replace the content of these dictionary's keys with an array containing the following strings: [...]
The solution is to specify a value transformer for the binding, which should be: OakStringToColorTransformer We do that in TODO’s Preferences.nib.
Yes, I saw it but I have two tiny things to mention: 1) The transformer converts a NSColor "only" to a String à la "#RRGGBB". If this is enough for the color picker's output, fine.
2) I always got an error if I tried to set the color for NSColorWell via -p 'color="#FF0000";'. The error was: NSCFString alphaComponent: selector not recognized. I also tried -p 'color="#FF0000FF";' but no success.
If I copy the same NSColorFromString routine from ValueTransformer.mm and use it for setting the color in Dialog.mm, it works!?
Hans