• 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: Watch for overflow when drawing string to NSView for printing?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Watch for overflow when drawing string to NSView for printing?


  • Subject: Re: Watch for overflow when drawing string to NSView for printing?
  • From: "Ian G. Gillespie" <email@hidden>
  • Date: Tue, 14 Jun 2005 08:01:54 -0400


I have an NSString that I would like to draw (using drawInRect:
withAttributes:?) to an NSView for printing.  As this string was
entered using a NSTextView, it could be very long, and I want to know
if it overflows the rect that I set it to draw in, and if so where in
the string it was clipped, so that I can continue the rest of the
string on an other page (rinse and repeat).
PLUS how to do this in pre-10.3?

There is a NSString method, sizeWithAttributes: that will return the size of a string as drawn in an NSView. You can use this to see if it is beyond the views bounds. Or perhaps there is an easier way?
_______________________________________________
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
  • Prev by Date: Re: NSDocument: Connecting the menubar to objects?
  • Next by Date: Re: Passing data to Core Data model
  • Previous by thread: Re: layoutManager drawGlyphs is moving lines up? (WAS: Watch for overflow when drawing...)
  • Next by thread: Passing data to Core Data model
  • Index(es):
    • Date
    • Thread