summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXWm.c
diff options
context:
space:
mode:
authorwolfsuit <wolfsuit>2004-02-14 01:26:48 (GMT)
committerwolfsuit <wolfsuit>2004-02-14 01:26:48 (GMT)
commit7e16e1390f3c1d424934e5031458ee09fa166f86 (patch)
treeef8286e046fc14d50c893e3624238064e45c5a16 /macosx/tkMacOSXWm.c
parent60f6fecb3068f40ba0e52153975314ce2e24bda2 (diff)
downloadtk-7e16e1390f3c1d424934e5031458ee09fa166f86.zip
tk-7e16e1390f3c1d424934e5031458ee09fa166f86.tar.gz
tk-7e16e1390f3c1d424934e5031458ee09fa166f86.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.c30
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);
+ }
}