Re(2): is [uiObject display] necessary?
Re(2): is [uiObject display] necessary?
- Subject: Re(2): is [uiObject display] necessary?
- From: Jens Bauer <email@hidden>
- Date: Fri, 7 Dec 2001 19:24:27 +0100
Hi Marcel,
On Fri, 7 Dec, 2001, Marcel Weiher <email@hidden> wrote:
{snip}
>
2. Fighting the framework and doing too much work
>
>
Even though you did a display update yourself using -display during
>
event-handling, the Cocoa event loop will still do its update-processing
>
afterwards. So your application will be doing extra, unecessary work.
>
You might think that using -display is somehow 'more direct', but it
>
isn't.
I do agree with you that "while the object is updating", you can do some
other work.
I tried this...
[uiObject setNeedsDisplay:YES];
-but that does not refresh immediately, however...
[uiObject display];
..actually updates immediately.
All these actions are done without user-interaction:
doStep1
updateMessageAndIcon
doStep2
updateMessageAndIcon
doStep3
updateMessageAndIcon
doStep4
updateMessageAndIcon
It's an installer-like application I'm writing.
In fact, it shouldn't be necessary to setNeedsDisplay, when calling
setTitle, setString or setImage, as they're normally refreshed
automatically.
I know about that if you change the text message 100 times within 20mS
(which is a bad idea anyway), it will be optimized, so the message is
displayed only once or twice, if not calling display each time, and the
application will finish much faster.
Love,
Jens