GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Fri Sep 19, 2014 7:54 pm

All times are UTC




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Optimizing GtkNotebook with identical children
PostPosted: Wed Jan 29, 2014 8:57 am 
Offline
Familiar Face

Joined: Wed Feb 03, 2010 3:27 pm
Posts: 6
Hello,
I have a GtkNotebook with a couple tabs that all contain identical content just showing different values.
I want to optimize this by having only one set of widgets that show the right values depending on the selected tab.

First solution would be to put the content outside the notebook with loosing the affiliation because the widgets are outside the notebook frame.
Second solution would be to just have a box as child for each tab and gtk_container_remove() and gtk_container_add() the content from one box to another.

Is it possible to add non-tab content to a notebook? Or is this what the "action_widgets" are about?
Is there any better solution? Which one is preferrable?

Thanks
Stefan


Top
 Profile  
 
 Post subject: Re: Optimizing GtkNotebook with identical children
PostPosted: Wed Jan 29, 2014 1:12 pm 
Offline
Never Seen the Sunlight

Joined: Mon Apr 28, 2008 5:52 am
Posts: 745
Location: UK
Hello,

Have you done some profiling on your code to make sure that optimisation would be worth doing all this extra work for what may end up being harder to read code? It looks like you are trying to do a large amount of work for very little gain.

_________________
E.


Top
 Profile  
 
 Post subject: Re: Optimizing GtkNotebook with identical children
PostPosted: Thu Jan 30, 2014 6:24 am 
Offline
Familiar Face

Joined: Wed Feb 03, 2010 3:27 pm
Posts: 6
You are right, it's not really necessary for performance reasons. Resizing the window is not as slick anymore but my development machine is some years old one and that's negligible. I just wanted to know if there's any "best practice" or workaround for such a special case to increase speed and lower memory footprint. If nothing's provided by the api I'm fine with doing it the intended way.


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group