[Openmcl-devel] keyDown events

Ron Garret ron at awun.net
Tue Nov 6 11:43:05 PST 2007


On Nov 6, 2007, at 11:31 AM, R. Matthew Emerson wrote:
>
> Also, in Real Life, you want to do all your drawing in #/drawRect:.   
> So, in this case, you'd have a slot (instance variable) in your  
> scribble-view, where you'd keep track of mouse clicks, maybe a list  
> of points or something.  All you'd do in #/mouseDown: would be to  
> add the point to the list, and then say (#/setNeedsDisplay: self  
> t).  #/drawRect: would then run through the list of points, drawing  
> them to the screen.
>
> Experimenting isn't real life, of course, but I wanted to mention it.


Thanks!  I was aware of the drawRect thing, though in this case it's  
actually an advantage to draw directly because it gives me a  
convenient way to erase a cluttered window and start over simply by  
resizing it :-)

rg




More information about the Openmcl-devel mailing list