summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXHLEvents.c
diff options
context:
space:
mode:
Diffstat (limited to 'macosx/tkMacOSXHLEvents.c')
-rw-r--r--macosx/tkMacOSXHLEvents.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/macosx/tkMacOSXHLEvents.c b/macosx/tkMacOSXHLEvents.c
index 0bd2d5e..d2843a8 100644
--- a/macosx/tkMacOSXHLEvents.c
+++ b/macosx/tkMacOSXHLEvents.c
@@ -126,9 +126,24 @@ static int ReallyKillMe(Tcl_Event *eventPtr, int flags);
- (void) handlePrintDocumentsEvent: (NSAppleEventDescriptor *)event
withReplyEvent: (NSAppleEventDescriptor *)replyEvent
{
- tkMacOSXProcessFiles(event, replyEvent, _eventInterp, "::tk::mac::PrintDocument");
+
+ NSString* file = [[event paramDescriptorForKeyword:keyDirectObject]
+ stringValue];
+ const char *printFile=[file UTF8String];
+ Tcl_DString print;
+ Tcl_DStringInit(&print);
+ if (Tcl_FindCommand(_eventInterp, "::tk::mac::PrintDocument", NULL, 0)) {
+ Tcl_DStringAppend(&print, "::tk::mac::PrintDocument", -1);
+ }
+ Tcl_DStringAppendElement(&print, printFile);
+ int tclErr = Tcl_EvalEx(_eventInterp, Tcl_DStringValue(&print),
+ Tcl_DStringLength(&print), TCL_EVAL_GLOBAL);
+ if (tclErr!= TCL_OK) {
+ Tcl_BackgroundException(_eventInterp, tclErr);
+ }
}
+
- (void) handleDoScriptEvent: (NSAppleEventDescriptor *)event
withReplyEvent: (NSAppleEventDescriptor *)replyEvent
{