Update NSView in function of events
Posted
by
Forchita
on Stack Overflow
See other posts from Stack Overflow
or by Forchita
Published on 2011-01-12T08:37:57Z
Indexed on
2011/01/12
14:54 UTC
Read the original article
Hit count: 191
Hi everyone!
I have a main view (subclass of NSView) and as i'm new to cocoa, i'd like to know how to update the view in function of events.
I know there are many methods that take events such as -(void)mouseMoved:(NSEvent*)event
or - (void)mouseClicked:(NSEvent*)event
My algorithm to determine what to do is ready. I want to know where I should update the main view: is it in the -(void)mouseMoved:(NSEvent*)event
or in the - (void)drawRect:(NSRect)dirtyRect
. And if it is in drawRect, then how should i pass the information to it?
Thanks in advance!
© Stack Overflow or respective owner