I am developing an app which has a 2D grid (approx 3 cols x 6 rows) of
thumbnails of images and an accompanying label. The elements in the grid
need to be rearranged / removed / new added at runtime (Peak could be 5-6
times a second).
Currently my rearrangement algorithm is not optimized since it is not the
main feature of the app. I do a bunch of gtk_container_remove and
gtk_grid_attach in a function called through g_timeout_add then exit from
I needed some information about when the layout and pixel calculations are
done to save on cpu cycles (if required).
- Are all the calculations done whenever we use gtk_container_remove and
gtk_grid_attach or are they done after exiting from the g_timeout_add
- Or the cpu cycles required for gtk_container_remove and gtk_grid_attach
are negligible (in my case) and I don't have to worry about it.