[fxruby-users] associating objects with FXTable rows

Scott Willson scott at butlerpress.com
Sat Apr 1 23:20:34 EST 2006

On Apr 1, 2006, at 8:11 PM, Mark Volkmann wrote:

> I'd like to associate an arbitrary object with a row in an FXTable. I
> thought I could do it using FXTableItems for my cells, but that
> doesn't work. Here is basically what I tried.
> item = FXTableItem.new(string_value, nil, some_object)
> table.setItem(row, column, item)
> some_object is an object from my ToDo class.
> This fails on the first line with "in `initialize': wrong argument
> type ToDo (expected Data)".
> Apparently I can't pass an arbitrary object as the last parameter of
> the FXTableItem constructor. What does it expect?
> Is there another way I can associate objects with my table rows?
> --
> R. Mark Volkmann
> Object Computing, Inc.

Try something like this:
FXTableItem.new(string_value, nil) { |item|
   item.data = some_object

More information about the fxruby-users mailing list