Re: [Newbie] Redraw design problem
Re: [Newbie] Redraw design problem
- Subject: Re: [Newbie] Redraw design problem
- From: Greg Hulands <email@hidden>
- Date: Thu, 5 Jun 2003 18:50:37 +1000
Have a look at the Sketch example /Developer/Examples/AppKit/Sktech.
Have a look at the SKTGraphicView and SKTGraphic. I think this is what
you are after.
Greg
On Thursday, June 5, 2003, at 06:01 PM, Alan Leigh wrote:
Hi all,
Ok here is my problem.
I have a view (well a couple) which redraw stuff (how about that).
I have objects which draw themselves to these views.
This all works fine. The problem is when the preferences change (I am
after the instant change, i.e. no 'Ok' button :) )...
When they change I send out a 'redrawOptionsChanged' notification,
which both the redraw view and the objects drawing themselves listen
for. I don't know how I can make a refresh happen at the right time.
If the view and the objects both hear the notification, the objects
don't have time to update to the new settings before the redrawView
tells them all to refresh. So basically you change an option, the view
stays the same but if I minimise the window then reopen it, all is
well.
So my next idea was that all the objects listen for new prefs, the
view doesn't. Then the objects fire off a notification saying "we need
to be redrawn" and then the view listens to that. The problem is that
there is more than one object, so the view ends up redrawing itself
once for each object.
What is the right way to handle this? No doubt there is an obvious
solution.....
I decided against having the objects call [NSUserDefaults
standardDefaults] (this is where all my drawings prefs etc are stored)
every time they drew themselves, as I read this was slow (they only
call this when they need to update themselves, so when they get a
notification)..... although it is seeming mighty attractive right
now....
Or maybe a second notification? So...
'redrawOptionsChanged' <- Objects and view listen for this
'refreshIfNeeded' <- View listens for this
??? Any hints / comments?
Cheers,
Alan
_______________________________________________
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.
_______________________________________________
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.