diff options
author | wolfsuit <wolfsuit> | 2004-02-14 01:08:28 (GMT) |
---|---|---|
committer | wolfsuit <wolfsuit> | 2004-02-14 01:08:28 (GMT) |
commit | 4c899ca0787f4fc4e71eb83694c5ee85f5bfaa72 (patch) | |
tree | d60273b901747b97991967ff18cfd24aebf2955d /macosx/tkMacOSXWm.c | |
parent | 4e5ce2ab17562b7dd7e866e1e127d0f3f6c185c6 (diff) | |
download | tk-4c899ca0787f4fc4e71eb83694c5ee85f5bfaa72.zip tk-4c899ca0787f4fc4e71eb83694c5ee85f5bfaa72.tar.gz tk-4c899ca0787f4fc4e71eb83694c5ee85f5bfaa72.tar.bz2 |
Applying Patch 112997, and hunting down a couple more places where we were
still using Pascal interfaces.
Diffstat (limited to 'macosx/tkMacOSXWm.c')
-rw-r--r-- | macosx/tkMacOSXWm.c | 30 |
1 files changed, 14 insertions, 16 deletions
diff --git a/macosx/tkMacOSXWm.c b/macosx/tkMacOSXWm.c index aa00e3a..6973213 100644 --- a/macosx/tkMacOSXWm.c +++ b/macosx/tkMacOSXWm.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXWm.c,v 1.7.2.1 2003/09/26 16:19:52 cc_benny Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.7.2.2 2004/02/14 01:08:29 wolfsuit Exp $ */ #include <Carbon/Carbon.h> @@ -4269,29 +4269,27 @@ TkSetWMName( TkWindow *winPtr, Tk_Uid titleUid) { - Str255 pTitle; + CFStringRef title; WindowRef macWin; - int destWrote; if (Tk_IsEmbedded(winPtr)) { return; } - Tcl_UtfToExternal(NULL, TkMacOSXCarbonEncoding, titleUid, - strlen(titleUid), 0, NULL, - (char *) &pTitle[1], - 255, NULL, &destWrote, NULL); /* Internalize native */ - pTitle[0] = destWrote; + + if (strlen(titleUid) > 0) { + title = CFStringCreateWithBytes(NULL, titleUid, strlen(titleUid), + kCFStringEncodingUTF8, false); + } else { + title = NULL; + } macWin = GetWindowFromPort(TkMacOSXGetDrawablePort(winPtr->window)); - /* - * FIXME: Convert this to SetWindowTitleWithCFString, we should - * use CFStrings and not pascal strings wherever they are supported, - * since at some point there will be encodings that can't be supported - * with the pascal string interfaces. - */ - - SetWTitle( macWin, pTitle); + SetWindowTitleWithCFString(macWin, title); + + if (title != NULL) { + CFRelease(title); + } } |