Hi,
I am developing an GTK+ application in a embedded processor. I am using Glade for UI development. GTK is very easy and a powerful tool for application development. Thanks for the continuous support by this forum. In my application, i have almost around 9 screens which i create as a separate fixed for each screen in glade. I will be creating a window in my code and will be adding the fixed in my window using gtk_container_add(). To change the screens with button press, i used to do gtk_container_remove() followed by gtk_container_add() with the new screen (fixed).
1.Is this a right way to change screens?
2.Is there any architectures to be followed while developing gtk+ applications for better memory management?
Hi @lb90,
Thanks for your quick reply. While changing the screens in this way, I can see that the memory increases when a new screen is called and when all the screens are opened atleast once, the memory stays stable. So i think that the memory of all fixed are stored in ram.
1.Is my view correct?
2.Can I unreference a screen by using g_object_unref() when a screen is changed? But while unreferencing, when the screen is called next time,I could see only blank screen. Can you suggest me a way to do this in a optimized way to use less memory?
Generally speaking, if you are working in an memory limited environment its best to be as stable as possible. If something is going to load several pages of controls then you might as well do it all at once and leave them in RAM (assuming they all fit). Creating them and deleting them might be lots of busy work for the memory manager without making a significant difference to the peak RAM of your program.