[fxruby-users] setting widget attributes
Lyle Johnson
lyle at knology.net
Tue Mar 28 15:09:29 EST 2006
On Mar 28, 2006, at 1:32 PM, Mark Volkmann wrote:
> However, if I do this
>
> self.visibleRows = 5
>
> then it does.
>
> Shouldn't it work without "self."?
Nope, and this is a Ruby thing (not particular to FXRuby, I mean). When
you do:
visibleRows = 5
Ruby assumes that you're initializing a local variable. You only invoke
the accessor method for the visibleRows attribute when you prepend it
with self (as you've discovered).
More information about the fxruby-users
mailing list