summaryrefslogtreecommitdiffstats
path: root/macosx
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2007-09-11 18:32:34 (GMT)
committerdgp <dgp@users.sourceforge.net>2007-09-11 18:32:34 (GMT)
commit4462f84415743f96fc1a0744d4ec040297685999 (patch)
tree11eb6860299f23712297ab8755a89a6491711007 /macosx
parentcb6b3761663fe1c05c044d2aa758fd75bb9c28ec (diff)
downloadtk-4462f84415743f96fc1a0744d4ec040297685999.zip
tk-4462f84415743f96fc1a0744d4ec040297685999.tar.gz
tk-4462f84415743f96fc1a0744d4ec040297685999.tar.bz2
merge updates from HEAD
Diffstat (limited to 'macosx')
-rw-r--r--macosx/tkMacOSXDialog.c18
1 files changed, 7 insertions, 11 deletions
diff --git a/macosx/tkMacOSXDialog.c b/macosx/tkMacOSXDialog.c
index 83e715d..1eef8a9 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.25.2.3 2007/09/04 17:44:22 dgp Exp $
+ * RCS: @(#) $Id: tkMacOSXDialog.c,v 1.25.2.4 2007/09/11 18:32:35 dgp 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;