Re: [MacRuby-devel] Problem with a window controller

2012-12-02 Thread david kramf
Thank you very much Andy and Jim I followed your remarks , played with the code and I am still surprised. It turns out that awakeFromNib is called before applicationDidFinishLaunching so there MyController is already initialized and has the correct window as the his instance variable. NSWindow

Re: [MacRuby-devel] Problem with a window controller

2012-12-02 Thread Andy Park
On Sunday, 2 December 2012, david kramf wrote: > Thank you very much Andy and Jim > I followed your remarks , played with the code and I am still surprised. > It turns out that awakeFromNib is called before applicationDidFinishLaunching > so there MyController is already initialized and has the c

Re: [MacRuby-devel] Problem with a window controller

2012-12-02 Thread J Silver
Hi David, Try NSLog instead of puts. Also you can override puts to #NSLog. I have some production MacRuby code up at https://github.com/jsilverMDX/GlobalChat2/tree/master/globalchat%202%20OSX that's in the App Store. Look here for an example of a working MacRuby app that uses IB and Sockets.

Re: [MacRuby-devel] MacBacon problem

2012-12-02 Thread stephen horne
On a related note to some things touched upon in this thread, it seems that in macbacon test scripts you don't need to require rubygems or mac_bacon, as this is done for you in the macbacon executable. Stephen On 30/11/2012, at 18:26, J Silver wrote: > Wow, didn't even know 1.9 required "ruby

Re: [MacRuby-devel] Problem with a window controller

2012-12-02 Thread Robert Carl Rice
Hi David, A couple of things I notice offhand in you code: The NSWindowController class defines accessor methods for "window" so you shouldn't redefine it with the Ruby attr_accessor method. Note: similarly NSViewController defines accessor methods for "view". You can configure IB to link the

Re: [MacRuby-devel] Problem with a window controller

2012-12-02 Thread david kramf
Hi Bob My code crashes if I omit the attr_accessor. Can you refer me to instructions of how to configure the IB to link to my controller as delegate (?) . In the examples I have in my book and ,if I am not mistaken, lectures I viewed in iTunes U ( the Stanford series ), they all used the awake