[Glade-users] text display trouble

Tomi Manninen oh2bns@sral.fi
02 Jul 2003 15:57:11 +0300


On Wed, 2003-07-02 at 15:17, f.parzefall@multitest.de wrote:

> I hadn't looked at gtk-demo. But now I have and it's all the
> same as the rest: create a GtkListStore, add lines to it and then
> create a GtkTreeView with it and there it stops.
> 
> But I already have the TreeView (created by glade) and simply
> want to add a new line to it (and delete an old one if they get
> to many) from time to time.

Ok, maybe you are missing the gtk_tree_view_set_model() part then?

In my code I get the treeview from glade generated code (with
help from lookup_widget() of course). Then I build a treestore
using gtk_tree_store_new/gtk_tree_store_append/gtk_tree_store_set.
And finally I set the model for the view:

 gtk_tree_view_set_model(treeview, GTK_TREE_MODEL(treestore));

To be honest though, I copied much of the code from somewhere
and I'm not quite certain I understand all of it as well as I'd
like to...

And also, I don't need to alter the view/store once it's built.
That may be different from your application.

-- 
Tomi Manninen           Internet:  oh2bns@sral.fi
OH2BNS                  AX.25:     oh2bns@oh2rbi.fin.eu
KP20ME04                Amprnet:   oh2bns@oh2rbi.ampr.org