On 03-01-18 19:33, Luís Marques wrote:

On Wed, 3 Jan 2018 15:24:10 +0100, Mike Wey wrote:

You would need to create an class that implements the TreeModelIF
interface.

Thanks! For the initial model filling, the example uses a rowInserted signal for each insertion. That seems inefficient to me. In other GUI toolkits there generally was a way to fill the model and send a single signal at the end to say that the model has changed. Only then would the view check to see how many items there would be in the model. I checked at https://developer.gnome.org/gtk3/unstable/GtkTreeModel.html but I didn't see anything appropriate. Do you really have to send a signal per each item being "inserted" in the model? (in my case the whole store is already filled when the view and the GTK model are created)

The rowInserted signal is to let the widgets that show your model know
about changes to the underling model. If you fill the model before
adding it to a treeview, or if the model already holds the data
internally you don't need to emit the signal.