• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
printing a different representation than what is on the screen
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

printing a different representation than what is on the screen


  • Subject: printing a different representation than what is on the screen
  • From: Dave Reed <email@hidden>
  • Date: Thu, 20 Jan 2011 09:24:03 -0500

I'm working on a document-based application that has a couple tabs. Most of the tabs contain NSTableViews, NSTextFields, etc.

I want to provide a way for the user to print the data contained in them (just text, possibly with some grid lines), but not the actual table view. I've read through (admittedly fairly quickly) the "Printing Topics for Cocoa" document from Apple but it is more geared towards printing what you see on the screen.

I also may want to print different data depending on which tab the user is on.

What is the appropriate way to do this? Do I override drawRect: for each tab such as:

- (void)drawRect:(NSRect)r {
   if ( [NSGraphicsContext currentContextDrawingToScreen] ) {
	[super drawRect:r]
   }
   else {
      // somehow send drawing instructions for the text I want
   }
}

or do I somehow create an off screen view that I "draw" the text and grid lines into?

A pointer in the correct direction or pointers to other documentation or examples would be appreciated.

Thanks,
Dave

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: printing a different representation than what is on the screen
      • From: Sherm Pendley <email@hidden>
  • Prev by Date: Re: Sending multiple files via Bluetooth using GameKit
  • Next by Date: Re: printing a different representation than what is on the screen
  • Previous by thread: Re: Sending multiple files via Bluetooth using GameKit
  • Next by thread: Re: printing a different representation than what is on the screen
  • Index(es):
    • Date
    • Thread