Re: Watch for overflow when drawing string to NSView for printing?
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