Bartosz Dz.
2009-Oct-08 16:28 UTC
[fxruby-users] Dynamic creation of a tabbed book of tables
Maybe just use instance_variable_set/instance_variable_get to set/get variables? -- Matma Rex - http://matma-rex.prv.pl/
James Johnson
2009-Oct-10 15:11 UTC
[fxruby-users] Dynamic creation of a tabbed book of tables
On Oct 8, 2009, at 10:43 AM, Eric Hutton wrote:> 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?Sorry for the delayed response, but I''ve been on vacation. Technically, you can always "get to" these widgets by navigating through the widget hierarchy using methods like FXWindow#each_child, but that can be a little tricky. Why don''t you just store them in arrays or hashes, e.g. customs_summary_year_tabs = [] customs_summary_tables = [] years_on_file.each do |year| customs_summary_year_tabs << FXTabItem.new(...) ... customs_summary_year_tables << FXTable.new(...) end Hope this helps, Lyle