FROM : Douglas Davidson
DATE : Fri Apr 08 22:54:19 2005
On Apr 8, 2005, at 1:47 PM, John Brownlow wrote:
> How does one 'force' the layout manager to do immediate layout, as
> opposed to doing it opportunistically when the runloop is idle?
>
To force immediate layout, simply ask a question that requires layout
to answer it. The header is generally pretty clear about which
methods will perform layout. For example, calling -
lineFragmentRectForGlyphAtIndex:effectiveRange: will force layout for
all glyphs up to at least the index specified, and all those in the
same line. -textContainerForGlyphAtIndex:effectiveRange: will force
layout for all glyphs up to at least the index specified, and with a
non-NULL second argument, all those in the same container.
It is certainly open to you to turn off background layout and to use
means like these to use your own mechanism to schedule layout at
times and for portions of the text that you choose.
Douglas Davidson
DATE : Fri Apr 08 22:54:19 2005
On Apr 8, 2005, at 1:47 PM, John Brownlow wrote:
> How does one 'force' the layout manager to do immediate layout, as
> opposed to doing it opportunistically when the runloop is idle?
>
To force immediate layout, simply ask a question that requires layout
to answer it. The header is generally pretty clear about which
methods will perform layout. For example, calling -
lineFragmentRectForGlyphAtIndex:effectiveRange: will force layout for
all glyphs up to at least the index specified, and all those in the
same line. -textContainerForGlyphAtIndex:effectiveRange: will force
layout for all glyphs up to at least the index specified, and with a
non-NULL second argument, all those in the same container.
It is certainly open to you to turn off background layout and to use
means like these to use your own mechanism to schedule layout at
times and for portions of the text that you choose.
Douglas Davidson
| Related mails | Author | Date |
|---|---|---|
| John Brownlow | Apr 8, 22:47 | |
| Douglas Davidson | Apr 8, 22:54 |






Cocoa mail archive

