[MacRuby-devel] observable ruby methods

2011-10-12 Thread Alex Greif
Hi, I bound an array to an NSArrayController and realized that not all array manipulation methods trigger the binding observer. These trigger: += -= This does not trigger << Is there a list which ruby methods cocoa can automatically register as observer for the classes Array, Hash, etc ? Thanks,

[MacRuby-devel] NSInvocationOperation usage Segmentation fault

2011-10-10 Thread Alex Greif
The following code crashes with a segmentation fault. Any idea whether I misunderstood the usage or it is a macruby bug? thanks, ALex. ---code--- framework 'Foundation' class Foo def bar puts 'bar' end end operation = NSInvocationOperation.alloc.i

[MacRuby-devel] performSelectorOnMainThread Problem

2011-10-10 Thread Alex Greif
The xcode documentation states that if the method performSelectorOnMainThread has the argument withObject:nil, then the nil means that the target method takes no arguments. The following code throws an ArgumentError wrong number of arguments (1 for 0): def foo self.performSelectorOnMainThrea

Re: [MacRuby-devel] macruby NSTask problem

2011-10-09 Thread Alex Greif
here an update: the problem seems to be with the notifier, because if I use the following code without the NSNotificationCenter, then, everything works fine, like the following sample code: task = NSTask.alloc.init task.currentDirectoryPath = "/" task.launchPath = "/bin/bash" task.

[MacRuby-devel] macruby NSTask problem

2011-10-07 Thread Alex Greif
Hi I tried the subprocess sample with the AsyncHandler from http://ofps.oreilly.com/titles/9781449380373/_foundation.html and found the following problem: if I execute the code many times (I tried 20 times) in my terminal with $ macruby sample.rb then 2-3 times it does not print any output. In th

Re: [MacRuby-devel] programatic binding (undefined bind method on NSTextField) SOLVED

2011-09-28 Thread Alex Greif
In the macirb I forgot to import 'Cocoa'. ANd in my App it seems that I had a typo. it now works now. Thanks > I even tried it on lion with the latest nightly build, and even there I > get "false" for the respond_to? > > Do I have to install something else beside macruby? > Or Why is the protoc

Re: [MacRuby-devel] programatic binding (undefined bind method on NSTextField)

2011-09-28 Thread Alex Greif
I even tried it on lion with the latest nightly build, and even there I get "false" for the respond_to? Do I have to install something else beside macruby? Or Why is the protocol not automatically added to the NSObject class? Thanks, Alex. > Have you got the right signature? Looking at > > http:

Re: [MacRuby-devel] programatic binding (undefined bind method on NSTextField)

2011-09-28 Thread Alex Greif
I am on 10.6.8 I tried with the 0.10 and the nightly build from 2011.9.27 and with both versions I get a "false" for the following statements in the macruby irb I have installed Xcode 3.2.4 Any Ideas why this does not work? - 0.10 - $ macirb irb(main):001:0> NSObject.alloc.i

Re: [MacRuby-devel] programatic binding (undefined bind method on NSTextField)

2011-09-27 Thread Alex Greif
The following code prints false twice So it seems that the protocol is not applied correctly. Is this a bug or do I need some other require/framework statements? BTW the result is the same if i use "framework 'Cocoa'" code - framework 'AppKit' puts NSObject.alloc.init.conform

Re: [MacRuby-devel] programatic binding (undefined bind method on NSTextField)

2011-09-27 Thread Alex Greif
would think it is a problem > importing `AppKit.framework` somewhere. > > On Sep 27, 2011, at 3:22 PM, Alex Greif wrote: > >> I want to bind my NSTextField to my model object. In objective-c I would >> do something like >> [mytextfield bind:@"value" toObject:m

[MacRuby-devel] programatic binding (undefined bind method on NSTextField)

2011-09-27 Thread Alex Greif
I want to bind my NSTextField to my model object. In objective-c I would do something like [mytextfield bind:@"value" toObject:myperson withKeyPath:@"address" options:nil]; But I have problems doing this in MacRuby with the following snippet: mytextfield = NSTextField.alloc.initWithFrame [20, 200