• 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
Re: Formatting NSView for printing...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Formatting NSView for printing...


  • Subject: Re: Formatting NSView for printing...
  • From: Omar Qazi <email@hidden>
  • Date: Tue, 8 Aug 2006 22:50:34 -0700


On Aug 8, 2006, at 10:23 PM, Colin Doncaster wrote:

I current have a function in MyDocument that returns an NSView* that is my printed view. Is there any recommended ways I can construct my view? Is it save just to NSView *printView = [ NSView new ]; and then draw on it what I want, can I even do this? Any help would be appreciated, there doesn't seem to be much info on printing anything other than already formatted NSView's in the documentation.

Do you mean the function returns the contentView of the NSWindow and you want to add more content (such as controls, or other views) to the document window? If you do, then you can use the addSubview: method to do so like so:


//Sample code to add new button to document

NSButton *myButton = [[NSButton alloc]initWithFrame:NSMakeRect (100,100,100,100)];

[[myDocument printedView]addSubview:myButton];


Omar Qazi, CEO ROFL Software :)


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Formatting NSView for printing...
      • From: Colin Doncaster <email@hidden>
References: 
 >Formatting NSView for printing... (From: Colin Doncaster <email@hidden>)

  • Prev by Date: Formatting NSView for printing...
  • Next by Date: Re: Formatting NSView for printing...
  • Previous by thread: Formatting NSView for printing...
  • Next by thread: Re: Formatting NSView for printing...
  • Index(es):
    • Date
    • Thread