Trouble with TreeView



Hi All,

I've built a TreeModel by creating a new TreeStore, and populating it with;

    for (rp = parent; rp; rp = rp->next) {
        gtk_tree_store_append(store, &iter, NULL);
        gtk_tree_store_set(store, &iter,
            0, rp->number, -1);

        for (ep = rp->child; ep; ep = ep->next) {
            gtk_tree_store_append(store, &child, &iter);
            gtk_tree_store_set(store, &child,
                0, ep->number,
                1, ep->name,
                2, ep->mean,
                3, ep->std_dev,
                -1);
        }
    }

Then created a new view, associated the model with it, and inserted columns.

I add the view to a scrolled window, which is in turn added to a dialog content area.

When I display the dialog, the tree is not quite what I expect.

In the first row (0), the values for name, mean and std_dev have not been defined, yet the mean and std_dev (which are floats) are shown as "0.000000". I don't want them to be displayed at all.

So to clarify, the first part of the tree looks like

> 1     |              |  0.000000  |  0.000000
      5 |  Fu Bar      |  0.345123  |  0.051234
      3 |  Snafu       |  0.765432  |  0.145678

Is there a way to suppress the display of some columns that don't make sense for the parent node, I.e. columns 1, 2, 3 in row 0?

Regards,
James.



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]