[fxruby-users] setting widget attributes

Joel VanderWerf vjoel at path.berkeley.edu
Tue Mar 28 15:01:52 EST 2006


Mark Volkmann wrote:
> I'm trying to set attributes of widgets in subclasses like the following.
> 
> class PersonTable < FXTable
>   def initialize(owner)
>     options = TABLE_COL_SIZEABLE
>     super(owner, nil, 0, options)
> 
>     visibleRows = 5
>     ...
>   end
> end
> 
> visibleRows doesn't get set.
> However, if I do this
> 
> self.visibleRows = 5
> 
> then it does.
> 
> Shouldn't it work without "self."?

That's a general ruby principle: any expression like

identifier = value

assigns to a local variable, even if there is a method identifier= .

-- 
      vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407


More information about the fxruby-users mailing list