diff options
author | das <das> | 2007-09-11 05:24:24 (GMT) |
---|---|---|
committer | das <das> | 2007-09-11 05:24:24 (GMT) |
commit | d13d64c12f225e321c7028a569483d75917cff0f (patch) | |
tree | 52d4ceeb5d1d26349f57afe82c1e494ad1845918 /macosx/tkMacOSXDialog.c | |
parent | e7dcc8b342311f2f9bd82343335d20b5daefec87 (diff) | |
download | tk-d13d64c12f225e321c7028a569483d75917cff0f.zip tk-d13d64c12f225e321c7028a569483d75917cff0f.tar.gz tk-d13d64c12f225e321c7028a569483d75917cff0f.tar.bz2 |
cleanup
Diffstat (limited to 'macosx/tkMacOSXDialog.c')
-rw-r--r-- | macosx/tkMacOSXDialog.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c index 2cecdbe..622149b 100644 --- a/macosx/tkMacOSXDialog.c +++ b/macosx/tkMacOSXDialog.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.4.2.18 2007/08/27 06:48:59 das Exp $ + * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.4.2.19 2007/09/11 05:24:24 das Exp $ */ #include "tkMacOSXPrivate.h" @@ -134,7 +134,7 @@ Tk_ChooseColorObjCmd( int result = TCL_ERROR; Tk_Window parent, tkwin = (Tk_Window) clientData; const char *title; - int i, picked = 0, srcRead, dstWrote; + int i, srcRead, dstWrote; CMError cmerr; CMProfileRef prof; NColorPickerInfo cpinfo; @@ -209,24 +209,20 @@ Tk_ChooseColorObjCmd( TkMacOSXTrackingLoop(1); err = ChkErr(NPickColor, &cpinfo); TkMacOSXTrackingLoop(0); + cmerr = CMCloseProfile(prof); if ((err == noErr) && (cpinfo.newColorChosen != 0)) { + char colorstr[8]; + color.red = cpinfo.theColor.color.rgb.red; color.green = cpinfo.theColor.color.rgb.green; color.blue = cpinfo.theColor.color.rgb.blue; - picked = 1; - } - cmerr = CMCloseProfile(prof); - - result = TCL_OK; - if (picked != 0) { - char colorstr[8]; - snprintf(colorstr, 8, "#%02x%02x%02x", color.red >> 8, color.green >> 8, color.blue >> 8); Tcl_SetObjResult(interp, Tcl_NewStringObj(colorstr, 7)); } else { - Tcl_ResetResult(interp); + Tcl_ResetResult(interp); } + result = TCL_OK; end: return result; |