I tracked down my NSView printing problem to the NSPrintPanel preview view. My
view printing now works again by overriding the default option to display the
small preview view:
def print
po = NSPrintOperation.printOperationWithView( @printableView )
po.printPanel.setOptions( 0 )
po.setShowsPrintPanel( true )
po.runOperationModalForWindow( @printableView.window, delegate:self,
didRunSelector:"printOperationDidRun:success:contextInfo:",
contextInfo:nil )
end
def printOperationDidRun( printOperation, success:success,
contextInfo:contextInfo )
puts "printOperationDidRun #{ success }"
end
or I can bypass the printPanel entirely.
It will take more experimenting to find out why NSPrintPanel is not creating a
graphics context for my NSView or why it would call my drawRect with an invalid
context; it works with my PDFView. But now
it's a low priority for me since I don't really need the NSPrintPanel preview.
Bob Rice
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel