2 Dec
2008
2 Dec
'08
9:37 p.m.
I am sure there is an easy answer to this question, but I have not figured it out after some experimenting (nor can I find an example in the examples)
What do I do if i want to subclass (say) an NSView ? And yet still employ that subclass with all the rest of the hot cocoa magic? (so without using nib/xibs)
I would do this to overwrite the drawRect callback for NSView for example - perhaps to do some animation.
class MyView < NSView def drawRect(r) end end or, even better in some cases a = view(:something) class << a def drawRect(r) end end -Ben