diff options
author | das <das> | 2003-05-13 02:42:57 (GMT) |
---|---|---|
committer | das <das> | 2003-05-13 02:42:57 (GMT) |
commit | da1bf4fb459b1e4f5e1be8a76e14029d4a9d331b (patch) | |
tree | dedfb9313098f6f370b756eefb7f3817c98756c5 /macosx/tkMacOSXClipboard.c | |
parent | 996aa5aa5d6fca18e46c0f25c7f25589a1d85003 (diff) | |
download | tk-da1bf4fb459b1e4f5e1be8a76e14029d4a9d331b.zip tk-da1bf4fb459b1e4f5e1be8a76e14029d4a9d331b.tar.gz tk-da1bf4fb459b1e4f5e1be8a76e14029d4a9d331b.tar.bz2 |
backport of Mac OS X specific changes on trunk since 8.4.2:
* macosx/tkMacOSXClipboard.c (TkSelGetSelection): Convert
'\r' to '\n' on the way into Tcl. (ingham)
* macosx/tkMacOSXMenu.c (EventuallyInvokeMenu): New function,
used to invoke menu commands at idle time.
(TkMacOSXDispatchMenuEvent): Don't immediately dispatch menu
commands, wait till the idle loop to do so. This is more like
what is done on Windows, and avoids the crash from destroying
a menu in it's command. (ingham)
* macosx/tkMacOSXHLEvents.c (ReallyKillMe): Don't force the shell
to exit. According to the OS X HI guidelines, it should be
possible to cancel an attempt to quit, and if we force the kill,
here, it would not be possible to implement this. (ingham)
* macosx/tkMacOSXApplication.r (removed):
* macosx/tkMacOSXLibrary.r (removed):
* macosx/tkMacOSXResource.r (removed):
* macosx/Wish.pbproj/project.pbxproj:
* macosx/tkAboutDlg.r: updated copyrights, cleaned up about box,
removed obsolete unused resource files. (steffen)
Diffstat (limited to 'macosx/tkMacOSXClipboard.c')
-rw-r--r-- | macosx/tkMacOSXClipboard.c | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/macosx/tkMacOSXClipboard.c b/macosx/tkMacOSXClipboard.c index 7bfa7ce..b327b90 100644 --- a/macosx/tkMacOSXClipboard.c +++ b/macosx/tkMacOSXClipboard.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tkMacOSXClipboard.c,v 1.2 2002/08/31 06:12:29 das Exp $ + * RCS: @(#) $Id: tkMacOSXClipboard.c,v 1.2.2.1 2003/05/13 02:42:57 das Exp $ */ #include "tkInt.h" @@ -81,8 +81,9 @@ TkSelGetSelection( } if (length > 0) { Tcl_DString encodedText; + char *data; - buf = (char *)ckalloc(length+1); + buf = (char *) ckalloc(length + 1); buf[length] = 0; err = GetScrapFlavorData(scrapRef, 'TEXT', &length, buf); if (err != noErr) { @@ -90,7 +91,17 @@ TkSelGetSelection( " GetScrapFlavorData failed.", (char *) NULL); return TCL_ERROR; } + + /* + * Tcl expects '\n' not '\r' as the line break character. + */ + for (data = buf; *data != '\0'; data++) { + if (*data == '\r') { + *data = '\n'; + } + } + Tcl_ExternalToUtfDString(TkMacOSXCarbonEncoding, buf, length, &encodedText); result = (*proc)(clientData, interp, |