On 30 Jul 2007, at 17:14, Thomas Aylott (subtleGradient) wrote:
If you can actually get the color and font info from tm_dialog. Please do!
Well, to handle a ColorPanel and Fontpanel is a bit tricky. If I try to run runModalForWindow:aColorPanel it works but TM hangs and one have to force quit it.
I also tried several other things like beginModalSession etc. but I didn't find a solution.
On other approach is to create a normal nib for it. (see attachment)
If one invoke it via "$DIALOG" -m ColourChooser.nib one will see a NSColorWell. Press on it and one can choose a color. Finally press 'Insert'. The bad thing is that tm_dialog is not able able to handle a NSColor. The output is
tm_dialog: Property list invalid for format { color = NSDeviceCMYKColorSpace 0 0 0.643153 0 1; returnButton = Insert; returnCode = 1; }
or
tm_dialog: Property list invalid for format { color = NSCalibratedRGBColorSpace 0.8 0.4 0.4 1; returnButton = Insert; returnCode = 1; }
On other issue is that the NSColorPanel is still visible even I closed the dialog.
Discussion: I don't know which approach would be the easiest one. I believe to use an external nib for that would be fine, but I don't know where I can train tm_dialog to handle NSColor objects.
Furthermore it would be the best to include in such a nib the desired output format like:
For RGB <key>red</key> <integer>233</integer> ...
or
For CMYK <key>Cyan</key> <integer >3</integer> ...
or
For Hex RGB <key>color</key> <string>FFDD01</string>
Any hints, comments on that?
Hans