diff options
author | das <das@noemail.net> | 2007-09-11 05:24:23 (GMT) |
---|---|---|
committer | das <das@noemail.net> | 2007-09-11 05:24:23 (GMT) |
commit | 69ee14b4a74f724b1756515c5ff891b6197e717f (patch) | |
tree | 52d4ceeb5d1d26349f57afe82c1e494ad1845918 /macosx | |
parent | 0b927c5f0af11362dab0f7cfb36074943a28fa85 (diff) | |
download | tk-69ee14b4a74f724b1756515c5ff891b6197e717f.zip tk-69ee14b4a74f724b1756515c5ff891b6197e717f.tar.gz tk-69ee14b4a74f724b1756515c5ff891b6197e717f.tar.bz2 |
cleanup
FossilOrigin-Name: 72175498d4fd22a1370b54646c32c4c21e64a99a
Diffstat (limited to 'macosx')
-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; |