Hi (think this got lost in the post)
Bill Atkins wrote:
> Are there any plans to replace the setter/getter methods with Ruby
> attribute accessors?
> e.g. "tree.set_font font" becomes "tree.font = font"
I think I might prefer this style too. To see what this syntax looks
like, you can fake it in Ruby fairly easily. Try the following (not
extensively tested) just after you do "require
''wxruby''"
cheers
alex
wx_classes = Wx::constants.map { | c | Wx::const_get(c) }.grep(Class)
wx_classes.each do | klass |
klass.instance_methods.grep(/^([gs]et|evt)_/).each do | meth |
if meth =~ /^get_(\w+)$/
klass.class_eval("alias :#{$1} :#{meth}")
elsif meth =~ /^set_(\w+)$/
klass.class_eval("alias :#{$1}= :#{meth}")
end
end
end
# for example
frame = Wx::Frame.new(nil, -1, ''GOOD TIMES'',
Wx::DEFAULT_POSITION, Wx::DEFAULT_SIZE)
p frame.title
frame.title = "BAD TIMES"