[Gtk-sharp-list] Gtk.TreeView and Gtk.ListStore update...

Alain Perry sensei@quarkup.org
Wed, 07 Jul 2004 17:16:13 +0100

Hi list,

I have a problem with my little piece of useless software here.
I have to classes, one of them represents my GUI, the other one contains
the data to display on the GUI and updates itself using a timer.
The GUI object uses a TreeView to display some of the data contained in
a ListStore in the other object.
When I first load the data, the TreeView displays it fine. I can even
add some rows to it and they get displayed. However, at some point, I
can keep adding rows, but they won't get displayed and the gtk app won't
"redraw" itself if I hide it behind another window and displays it
again. If I change window size, it will redraw, but the data still is
not up-to-date.
Reading some messages which seemed related, I understood that it might
be because gtk is not thread-safe, and that I had to use a ThreadNotify
object. I declared a ThreadNotify object in the GUI class, and called
the WakeupMain() method from my data object when data is added. However,
since I had no idea what to put in my ReadyEvent delegate, I
reassociated the TreeView with its ListStore through the Model property.
This does not change anything however, and since I'm quite new to
threading matters (well, I guess one could say I'm a newbie in
programming anyway) I call for your help.

If needed and since I might not have explained all this in a clear
enough fashion, I can put the code online somewhere...

Thanks for any pointers,

Alain Perry