[Glade-users] Re: Destroy and rebuild a treeview widget



Ruch Guillaume wrote:

Hi,

Can somebody tell me what's the function to display a new widget in a
container? I finally managed to build my dynamic tree (thanks
Tristan ;) ) but It still displays nothing... I tried to use
gtk_container remove/add but it didnt change anything... Got an idea?
I think it'd work if i destroy.rebuild the whole window but maybe
there's another way...


 

You must call gtk_widget_show() on widgets that you want to be visible
(or set the visible property to true in glade)... or call 
gtk_widget_show_all()
on some parent in the heirarchy (that may be the problem).

[...]

 liststore=gtk_list_store_newv (cols, types);

 g_free (types);

 gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), 
                      GTK_TREE_MODEL(liststore)); 
 

Hmmm seems that you are leaking the liststore every time, unreffing
it here should pass ownership of the model to the treeview... so that
next time you set the model the last model will be finalized.

Cheers,
                                  -Tristan




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