I have a custom GtkContainer class that nicely orders widgets in an array, supports headers etc. (it is very simple)
but i am having the following issue:
if you: Remove the widget from a container (while keeping a reference around)
then: Add it to a container again it takes a long time. (up to several seconds.)
Now today I had a few minutes to hunt down where this time was spend, and it turns out to be spend in the: “reset_rc_styles_recurse”, this is an internal GTK function. Further investigation turned out that this function takes around 1.3 ms (worstcase) for each widget packed in the container. The widget it is called on consists out of a an eventbox, with a hbox in it, an image and 2 labels. So not very big. Removing the 2 labels reduces the time to 0.6, removing the image and keeping the label causes a similar speedup.
But why does it take this long? If I have 1300 albums in the list it just takes crazy long, for something that hasn’t even changed…