Re: Drawing text "with NSText"
Re: Drawing text "with NSText"
- Subject: Re: Drawing text "with NSText"
- From: publiclook <email@hidden>
- Date: Sun, 31 Aug 2003 16:32:08 -0400
On Sunday, August 31, 2003, at 04:19 PM, Alastair J.Houghton wrote:
On Sunday, August 31, 2003, at 08:57 pm, publiclook wrote:
On Sunday, August 31, 2003, at 01:23 PM, Alastair J.Houghton wrote:
From what I can see, it would make sense to use an NSTextStorage, an
NSTextLayoutManager and an NSTextContainer to render text... perhaps
this is what the documentation means?
There is nothing wrong with NSText's -setString and -dislay methods.
What makes you say that NSText isn't capable of drawing all of the
incidental text in a window such as labels ?
Well I suppose it is, but it just seems surprising that you'd use a
subclass of NSView to do this; for one thing, it means you've got to
get it into the right place in the view hierarchy before you can draw.
I suppose it does have the advantage though that the text system has
more control over the view it is rendering into, but it seems odd,
that's all.
The field editor is a view that is inserted in the view hierarchy as
needed to draw text.
My original concern was that perhaps moving a view would cause the
superview to redraw, which would obviously make using an NSView
impossible, but I just knocked-up a toy application that demonstrates
quite clearly that that isn't the case, so I suppose it's fine.
It is routine to add and remove views to the view hierarchy.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.