Drawing in Custom Views
Hey, just saw the previous question regarding an example from the Cocoa book. I'm currently trying play with custom views and paths. Right now I'm trying the Example from page 240 »Drawing with NSBezierPath« but I can't get the path to draw. I uploaded the xcode project onto http://smyck.org/drawing.zip The Controller is quite simple http://pastie.textmate.org/private/kafqjbqoml48otms0ddcqq Something is not right but I don't know what - maybe one of you more experienced cocoa coders can help me out. Kind regards, John
Ah never mind. If I put the path drawing code directly into the drawRect method it all works fine. The whole thing now looks like this: http://pastie.textmate.org/private/rczadjlgyv63txzv6raea ~ John On 25.10.2009, at 20:36, John-Paul Bader wrote:
Hey, just saw the previous question regarding an example from the Cocoa book.
I'm currently trying play with custom views and paths. Right now I'm trying the Example from page 240 »Drawing with NSBezierPath« but I can't get the path to draw.
I uploaded the xcode project onto http://smyck.org/drawing.zip
The Controller is quite simple http://pastie.textmate.org/private/kafqjbqoml48otms0ddcqq
Something is not right but I don't know what - maybe one of you more experienced cocoa coders can help me out.
Kind regards, John _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
Hey John, You shouldn't need to put everything in drawRect:. In your original, you're stomping @path in your drawRect. :) --Mike On Oct 25, 2009, at 4:21 PM, John-Paul Bader wrote:
Ah never mind. If I put the path drawing code directly into the drawRect method it all works fine.
The whole thing now looks like this: http://pastie.textmate.org/private/rczadjlgyv63txzv6raea
~ John
On 25.10.2009, at 20:36, John-Paul Bader wrote:
Hey, just saw the previous question regarding an example from the Cocoa book.
I'm currently trying play with custom views and paths. Right now I'm trying the Example from page 240 »Drawing with NSBezierPath« but I can't get the path to draw.
I uploaded the xcode project onto http://smyck.org/drawing.zip
The Controller is quite simple http://pastie.textmate.org/private/kafqjbqoml48otms0ddcqq
Something is not right but I don't know what - maybe one of you more experienced cocoa coders can help me out.
Kind regards, John _______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
_______________________________________________ MacRuby-devel mailing list MacRuby-devel@lists.macosforge.org http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel
participants (2)
-
John-Paul Bader
-
Michael Shapiro