GTK4 SignalListItemFactory connect_bind

Hi,

I’m facing a problem I can’t really wrap my head around:

i’ve implemented the connect_bind signal in order to fill ListItem widgets with content. In here i also create new Image widget via gtk_image_new_from_file which is suuuper slow for large images. For whatever reasons.

Now here is what bugs me: the connect_bind gets called every time a selection on the list happens and it re-does the whole widgets, including the expensive image widget creation.

What am i missing?

Regards

Hi,

You should create the GtkImage in the Gtk.SignalListItemFactory::setup handler, to avoid recreating it every time the model changes.

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.