Hmm, no, got that wrong, so this will create each of the tabbed tables, but the problem is that the instance variable names will be only associated with the last objects created, so there is no way to reference and update values in the earlier tables (without removing and recreating them of course).
I guess what I need is to be able to use some sort of hash of the object ids for the individual tabs and tables created? ummm maybe using something like eachChildRecursive to nab the object ids?
On Wed, Oct 7, 2009 at 5:56 PM, Eric Hutton
<eric.hutton@...> wrote:
Hi all,
So I'm trying to create a bunch of tabbed tables in a tabbook, but I don't know in advance how many I will need, the number will depend on some data being read in by the system.
doing this:
years_on_file.each do |year|
@customs_summary_year_tab = FXTabItem.new(@customs_summary_tabbook, " #{year} ",
:opts => TAB_TOP_NORMAL)
@customs_summary_year_frame = FXHorizontalFrame.new(@customs_summary_tabbook,
:opts => FRAME_THICK|FRAME_RAISED|FRAME_LINE)
@customs_summary_table = FXTable.new(@customs_summary_year_frame,
:opts => TABLE_COL_SIZABLE|TABLE_ROW_SIZABLE|LAYOUT_FILL|TABLE_READONLY)
@customs_summary_table.setTableSize(num_of_rows, num_of_cols)
@customs_summary_table.rowHeaderWidth = $row_col_frame_size
@customs_summary_table.columnHeaderHeight = $row_col_frame_size
... more code that goes on to fill data into each table...
end
will generate a number of tabs, but, of course, they all get filled with the identical data (that generated by the last iteration through the block). I'm thinking that myabe I need to somehow use some sort of dyanmic naming scheme for my tabs and tables, but I'm at a loss as to how to do that.
Any suggestions?
Thanks!
_______________________________________________
fxruby-users mailing list
fxruby-users@...
http://rubyforge.org/mailman/listinfo/fxruby-users