Another approach, more row-oriented and therefore possibly a bit less
confusing s to create rows and then add items.
1. Create the grid
create grid
2. Add the root row
grid.insert_new_row (1)
3. Snag newly added row
l_row := grid.row (1)
4. Add root item to root row
l_row.set_item (1, create {EV_GRID_LABEL_ITEM}.make_with_text
("Root"))
Now that you have a root, you're off to the races as before
5. Add a child row to the root row
idx := idx + 1; grid.insert_new_row_parented (idx, l_row)
6. Snag the new row
l_row := grid.row (idx)
7. Add a suitable child item to the new row
row.set_item (idx, create {EV_GRID_LABEL_ITEM}.make_with_text ("child
of..."))
R
==================================================
Roger F. Osmond
> -------- Original Message --------
> Subject: [eiffel_software] Re: EV_GRID questions
> From: "boxer41a" <
[hidden email]>
> Date: Tue, September 08, 2009 12:59 pm
> To:
[hidden email]
> Okay, another look. Missed a step on first look. I think I have the basic sequence and am off to try. Thanks again for the help.
> -- 1. Create an [descendent of] EV_GRID_ITEM.
> create root_item.make_with_text ("Root")
> -- 2. Add the item to the EV_GRID.
> grid.set_item (1, 1, root_grid_item)
> -- I never explicitely create an EV_ROW?
> -- 3. Get the EV_GRID_ROW in which the label was placed.
> row := root_item.row
> -- I would never have thought to querry the
> -- EV_GRID_ITEM to have it get an EV_GRID_ROW
> -- [I assume] from the EV_GRID.
> -- 4. Let that EV_ROW create a new EV_ROW as child.
> row.insert_subrow (subrow_count + 1)
> -- 5. Get that new child row.
> row := row.subrow (row.subrow_count)
> -- 6. Create a new [descnedant of] EV_GRID_ITEM.
> create child_item.make_with_text ("child of...")
> -- 7. Add the item to the row.
> row.set_item (1, child_item)
> -- 8. Repeat appropriate steps.
> -- Little fuzzy in step 7 as to which column to use. I assume the "1" in first argument to ` above refers to the first column (the one with the expand/contract icon) of the EV_GRID to which the EV_ROW belongs?