[Glade-users] Treeview doesnt refresh upon reopenning window



On Mon, 2007-04-23 at 22:14 +0800, Jason Brisbane wrote:
Hello All,

I am looking for a fix for a Treeview issue that I am having.

I have created a Treeview that gets its data from a database and 
populates the list with the results of the database.
This works well as even if the database table was empty (rows=0) then it 
still displays the headers (better than I thought).

In my example, I have a treeview on one half of the screen and the 
database fields showing the data on the right (table). This shows the 
data just wonderfully.
If I add a record, or conversely if I select a record and delete it, the 
treeview doesnt get updated.
I am calling the _show function after each time, but I dont believe that 
the gtk_destroy_treeview is actually doing its job. Surely it would kill 
the treeview, model, store, and everything with it when you kill it?

Here is the "_show" code. Of course this works fine on starting the 
window the first time but doesnt refresh.
I get the following message when the window tries to update:
(battlemaster:11819): Gtk-CRITICAL **: gtk_scrolled_window_add: 
assertion `bin->child == NULL' failed



 gtk_widget_destroy(lookup_widget(widget, "treeview4"));

That "lookup_widget" call will only work the first time, won't it?
After that the particular treeview will no longer exist.

Maybe you should get the child of the scrolled window and
gtk_container_remove() that instead.

Damon






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