Re: [MacRuby-devel] Using Virtus or SmartProperty as outlets?

2012-11-21 Thread Colin Thomas-Arnold
What happens if you use BOTH attr_accessor and attribute - the first for the IB outlet, and the other for validation. Just a thought. On Nov 21, 2012, at 11:08 PM, david kramf wrote: > "Basically, I need to make sure that when I ask for an integer, I get an > integer. And when I want a strin

Re: [MacRuby-devel] Using Virtus or SmartProperty as outlets?

2012-11-21 Thread david kramf
"Basically, I need to make sure that when I ask for an integer, I get an integer. And when I want a string - I can reject anything but strings." Can't you use Ruby services like is_a? to force it ? Thanks, David Kramf On Nov 21, 2012, at 10:04 PM, Carolyn Ann Grant wrote: > Basically, I need to m

Re: [MacRuby-devel] Using Virtus or SmartProperty as outlets?

2012-11-21 Thread Carolyn Ann Grant
Sorry - I didn't make that clear! You're right, Stephen: I'd like to Virtus' "attribute" or SmartProperty's "property" *instead* of attr_accessor. I can roll my own solution, but I'd like to not have to! (Besides laziness, and the strong possibility of introducing bugs into any solution I come

Re: [MacRuby-devel] Using Virtus or SmartProperty as outlets?

2012-11-21 Thread stephen horne
Hi Carolyn, I can't help with Virtus or SmartProperty, but I think for MacRuby to recognise an outlet in your code you need to use 'attr_accessor', not 'attribute'. Maybe you could use the various types of input fields to ensure the values are numbers or strings, and then query their stringValu

[MacRuby-devel] Using Virtus or SmartProperty as outlets?

2012-11-21 Thread Carolyn Ann Grant
I've done a bit of Googling, but couldn't find anything on this. I'd like to use something like SmartProperties (for lightweight situations) or Virtus (when I absolutely must have industrial-strength validations, etc) as outlets. My experiments, such as they are, aren't helping me any! What, if