Hi,
I'm not sure if this is technically supposed to work in MacRuby but it
definitely works in objective-c.
class MyClass < NSWindowController
attr_accessor :someTextField
def name()
return @name
end
def setName(value)
@name = value
end
def windowDidLoad()
@name = "Robert"
self.someTextField.bind("value", toObject:self,
withKeyPath:"name", options:nil)
end
end
I also tried binding the text field's value directly via interface builder but
it doesn't work there either. Interestingly if you set the "name" on the class
inside MacRuby it'll update the text field but updating the text field via the
GUI doesn't bring the new value back down into MacRuby.
Are bindings something that have to be done with Cocoa controllers?
Thanks,
Robert Payne
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel