summaryrefslogtreecommitdiffstats
path: root/win/tkWinWm.c
diff options
context:
space:
mode:
authorchengyemao <chengyemao>2005-01-31 04:08:32 (GMT)
committerchengyemao <chengyemao>2005-01-31 04:08:32 (GMT)
commitce7eccff48f0a1c155ce5f0482ef25196b71b625 (patch)
tree9cef8dfe2be9883d20aec5496e5f1ddbe9754d3f /win/tkWinWm.c
parentdaaa68a2ed8d404a1c6685d4a6e15db3ed4ac9b4 (diff)
downloadtk-ce7eccff48f0a1c155ce5f0482ef25196b71b625.zip
tk-ce7eccff48f0a1c155ce5f0482ef25196b71b625.tar.gz
tk-ce7eccff48f0a1c155ce5f0482ef25196b71b625.tar.bz2
Modified to handle a wide-character title string of a toplevel
Diffstat (limited to 'win/tkWinWm.c')
-rw-r--r--win/tkWinWm.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/win/tkWinWm.c b/win/tkWinWm.c
index e680145..6551081 100644
--- a/win/tkWinWm.c
+++ b/win/tkWinWm.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: tkWinWm.c,v 1.94 2005/01/16 00:23:13 chengyemao Exp $
+ * RCS: @(#) $Id: tkWinWm.c,v 1.95 2005/01/31 04:08:32 chengyemao Exp $
*/
#include "tkWinInt.h"
@@ -4958,9 +4958,13 @@ WmTitleCmd(tkwin, winPtr, interp, objc, objv)
}
if (objc == 3) {
if(wrapper) {
- char buf[256];
- GetWindowText(wrapper, buf, 256);
- Tcl_SetResult(interp, buf, TCL_VOLATILE);
+ char buf[512];
+ Tcl_DString titleString;
+ int size = tkWinProcs->useWide? 256:512;
+ (*tkWinProcs->getWindowText)(wrapper, (LPCTSTR)buf, size);
+ Tcl_WinTCharToUtf(buf, -1, &titleString);
+ Tcl_SetResult(interp, Tcl_DStringValue(&titleString), TCL_VOLATILE);
+ Tcl_DStringFree(&titleString);
} else {
Tcl_SetResult(interp, (char *)
((wmPtr->title != NULL) ? wmPtr->title : winPtr->nameUid),