Re: How can I implement labels without the overhead of an NSTextField?
Re: How can I implement labels without the overhead of an NSTextField?
- Subject: Re: How can I implement labels without the overhead of an NSTextField?
- From: email@hidden
- Date: Mon, 13 Dec 2004 00:36:23 +0000
>Well, that may be your problem. NSTextViews are fairly expensive objects.
>You want to use NSTextFields (although maybe you are doing that already and
>just don't know the difference?).
Yes, I am already using NSTextFields, but they are slow. I keep getting the two names mixed up.
>You will get nowhere fast on this list with that attitude.
This scrolling issue is a miniscule detail of my application and I would not like to spend any more time on it than I have to. Futhermore, this is the only application I plan to port to the Mac, ever. Reading books about and gaining detailed knowledege of the Cocoa drawing classes would be a poor use of time for me.
>Or possibly vice versa. NSTextViews are heavyweight objects in memory
>terms, but they do redraw quickly after initial layout. NSTextFields
>store less state, which means that they may take longer to redraw (but
>maybe not, since there is quite a bit of optimization for common types
>of strings). Under the circumstances I would suspect that the real
>culprit is an excess of views; using a large number of views rather
>than a single custom view is going to be costly no matter what class of
>view is used. However, I think the larger point here is that it is
>impossible to tell given the limited details and the lack of any real
>performance testing. Sampling would probably make the problem obvious
>right away.
What is sampling? It is easy to test this out. Go into interface builder. Place a large image into an NSScrollView, resize it so that it takes up the top half of the form. Then, generate about 300 or so NSTextFields dragged from the Small System Text palette, and place them in an NSScrollView. Resize so that it fills the bottom half of the form. Then go to File, Test Interface. Scroll around in both NSScrollViews. You will see that the image scrolling is easily 5-10 times more responsive. At least it is on my system, I am using a G3 300Mhz.
I can upload my project files if you are interested, just let me know.
_______________________________________________
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