summaryrefslogtreecommitdiffstats
path: root/macosx/tkMacOSXPrint.c
diff options
context:
space:
mode:
authorKevin Walzer <kw@codebykevin.com>2021-07-03 22:01:11 (GMT)
committerKevin Walzer <kw@codebykevin.com>2021-07-03 22:01:11 (GMT)
commit83e47456f9fcc95c5c7e42da2a94bbcf45b0d4d7 (patch)
tree89ba1c55243cf9c9a1739866326c6c709c954785 /macosx/tkMacOSXPrint.c
parentf8d8b14443463897e316ca7955796dcaef1823b5 (diff)
downloadtk-83e47456f9fcc95c5c7e42da2a94bbcf45b0d4d7.zip
tk-83e47456f9fcc95c5c7e42da2a94bbcf45b0d4d7.tar.gz
tk-83e47456f9fcc95c5c7e42da2a94bbcf45b0d4d7.tar.bz2
Mac printing works
Diffstat (limited to 'macosx/tkMacOSXPrint.c')
-rw-r--r--macosx/tkMacOSXPrint.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/macosx/tkMacOSXPrint.c b/macosx/tkMacOSXPrint.c
index fcb5663..cd55975 100644
--- a/macosx/tkMacOSXPrint.c
+++ b/macosx/tkMacOSXPrint.c
@@ -23,7 +23,7 @@
/* Forward declarations of functions and variables. */
NSString * fileName = nil;
CFStringRef urlFile = NULL;
-int StartPrint(ClientData clientData, Tcl_Interp *interp, int argc, Tcl_Obj *const objv[]);
+int StartPrint(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]);
OSStatus FinishPrint(NSString * file, int buttonValue);
int MacPrint_Init(Tcl_Interp * interp);
@@ -69,9 +69,9 @@ int MacPrint_Init(Tcl_Interp * interp);
*----------------------------------------------------------------------
*/
-int StartPrint(ClientData clientData, Tcl_Interp *interp, int argc, Tcl_Obj *const objv[]) {
+int StartPrint(ClientData clientData, Tcl_Interp *interp, int objc, Tcl_Obj *const objv[]) {
- void clientData;
+ (void) clientData;
NSPrintInfo * printInfo = [NSPrintInfo sharedPrintInfo];
NSPrintPanel * printPanel = [NSPrintPanel printPanel];
int accepted;
@@ -82,7 +82,7 @@ int StartPrint(ClientData clientData, Tcl_Interp *interp, int argc, Tcl_Obj *con
OSStatus status = noErr;
/* Check for proper number of arguments. */
- if (objc != 2) {
+ if (objc < 2) {
Tcl_WrongNumArgs(interp, 1, objv, "file");
return TCL_ERROR;
}
@@ -92,8 +92,7 @@ int StartPrint(ClientData clientData, Tcl_Interp *interp, int argc, Tcl_Obj *con
CFRetain(urlFile);
/* Initialize the delegate for the callback from the page panel. */
- PrintDelegate * printDelegate = [
- [PrintDelegate alloc] init];
+ PrintDelegate * printDelegate = [[PrintDelegate alloc] init];
status = PMCreateSession( & printSession);
if (status != noErr) {
@@ -175,7 +174,7 @@ OSStatus FinishPrint(NSString * file, int buttonValue) {
printSettings = (PMPrintSettings)[printInfo PMPrintSettings];
/*Handle print operation.*/
- if (buttonValue = NSModalResponseOK) {
+ if (buttonValue == NSModalResponseOK) {
if (urlFile == NULL) {
NSLog(@ "Could not get file to print.");