Re: Trouble with knowsPageRank:
Re: Trouble with knowsPageRank:
- Subject: Re: Trouble with knowsPageRank:
- From: Matt Neuburg <email@hidden>
- Date: Thu, 14 Dec 2006 10:40:24 -0800
- Thread-topic: Trouble with knowsPageRank:
On Thu, 14 Dec 2006 12:51:59 +0100, Konni Scheller <email@hidden>
said:
>Hi,
>
>I've a lot of data sets to print. But I don't know how tall the rect
>for a data set is until it is printed. This is because a field in the
>data set can have free text, which could be very long[1], and
>therefore I don't know how tall is the line until it is
>calculated.
>
>So I really don't know the size of the NSView to print until I go
>thru all of the data sets.
>
>The function *knowsPageRange:* now is the problem. It looks strange
>to me that I've to do the same calculations twice: one time for
>*knowsPageRange* and one time the same again for *drawRect:*
>
>Is there a simple way to avoid the double calculations? It looks very
>inefficient to me.
One solution is not to use knowsPageRange for this. Just use the
adjustPageHeightNew: mechanism. This is a wonderful device because the call
is automatically passed along to all subviews of your main printing view. So
if every block of material that is to be printed is itself a subview, then
any subview can say where to split itself (or can prevent itself from being
split). If every block of material knows how to draw itself and how to split
itself (or prevent itself from being split), then printing just happens, and
it just happens once; in fact, your main printing view's drawRect can be
empty.
m.
--
matt neuburg, phd = email@hidden, <http://www.tidbits.com/matt/>
A fool + a tool + an autorelease pool = cool!
AppleScript: the Definitive Guide - Second Edition!
<http://www.amazon.com/gp/product/0596102119>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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