Re: [MacRuby-devel] sub classing with hot cocoa

2008-12-03 Thread Laurent Sansonetti
I noticed a strange behavior. Including the HotCocoa::Behaviors module in subclasses indeed seem to merge the appropriate custom methods. >> class MyButton < NSButton; include HotCocoa::Behaviors; end => MyButton >> b = MyButton.new => 0 >> b.on_action {} => 0 But extending an existing object

Re: [MacRuby-devel] sub classing with hot cocoa

2008-12-03 Thread Richard Kilmer
class MyView < NSView include HotCocoa::Behaviors def drawRect(rect) #do something... end end That HotCocoa::Behaviors was what you were missing. On Dec 3, 2008, at 12:58 AM, John Shea wrote: Hi Ben, thanks for your answer. I tried that initially, but my subclass was having

Re: [MacRuby-devel] sub classing with hot cocoa

2008-12-02 Thread John Shea
Hi Ben, thanks for your answer. I tried that initially, but my subclass was having problems being added to the layout view. Anyway - somehow I got something going a little further - the important thing was to have a create method which has : alloc.initWithFrame([0, 0, *GameSize]) in my NS

Re: [MacRuby-devel] sub classing with hot cocoa

2008-12-02 Thread Benjamin Stiglitz
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 with

[MacRuby-devel] sub classing with hot cocoa

2008-11-29 Thread John Shea
Hi folks, 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