diff options
author | wolfsuit <wolfsuit> | 2004-02-14 01:26:48 (GMT) |
---|---|---|
committer | wolfsuit <wolfsuit> | 2004-02-14 01:26:48 (GMT) |
commit | 13d545c78a265c3f8baeba7be014008232c3a54a (patch) | |
tree | ef8286e046fc14d50c893e3624238064e45c5a16 /macosx/tkMacOSXWm.c | |
parent | 88c035ccaf4a878cadd321f795ba22287b1147f2 (diff) | |
download | tk-13d545c78a265c3f8baeba7be014008232c3a54a.zip tk-13d545c78a265c3f8baeba7be014008232c3a54a.tar.gz tk-13d545c78a265c3f8baeba7be014008232c3a54a.tar.bz2 |
Apply patch 112997, and kill a few more places where we were still using
Pascal string 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 ff4b41e..0402e6a 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.9 2004/01/13 02:06:01 davygrvy Exp $ + * RCS: @(#) $Id: tkMacOSXWm.c,v 1.10 2004/02/14 01:26:49 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); + } } |