Re: GtkTreeView isn't updating when GtkListStore appended and set



Le 06/01/2014 22:10, jordannh fastmail fm a écrit :
I suppose an attachment would be helpful (weird that it didn't send).

OK, better now indeed.

So, your problem is that you don't add columns to your tree view.  A
TreeView [1] displays TreeViewColumns [2], which itself contain
CellRenderer [3].  Your UI definition lacks the columns and cell
renderers, so it effectively displays nothing, although the data is there.

You need to add a TreeViewColumn child to your TreeView widget, and a
CellRendererText to your column.

In Glade, right click on your tree view, go to the Hierarchy tab, and
click Add.
Now, right click on the column, and choose "Add a child Text" (or
something else, depending on what you want to display).
Finally, you need to define what that renderer displays, so you change
its "Text" property to your label column (change the "unset" dropdown to
"label - gchararray").

Now you should be all set and see your content.  You can of course add
several columns, and cells in each columns.  That will only depend on
your needs.


Regards,
Colomban


[1]
https://developer.gnome.org/gtk3/stable/GtkTreeView.html#GtkTreeView.description
[2]
https://developer.gnome.org/gtk3/stable/GtkTreeViewColumn.html#GtkTreeViewColumn.description
[3]
https://developer.gnome.org/gtk3/stable/GtkCellRenderer.html#GtkCellRenderer.description


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