GTK+ Forums

Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
It is currently Thu Oct 23, 2014 4:33 am

All times are UTC




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: GtkExpander help
PostPosted: Tue Jun 05, 2007 9:01 pm 
Offline

Joined: Thu Apr 12, 2007 7:35 pm
Posts: 3
I am sure this is simple but I haven't figured it out yet. I have a widget in a GtkExpander, when I collapse the expander I would like my window to resize to reclaim the space. How is it done?


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 05, 2007 11:45 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 12:07 am
Posts: 563
Location: Portland, OR USA
Hmmm. I know that if you were to make the window fixed using gtk_window_set_resizable(GTK_WINDOW(window), FALSE) then the window would react (snap closed around) the GtkExpander widget. However, I don't know how this would be done with a sizable window.

Furthermore, if you are using a resizable window, changing it's size programatically in response to the GtkExpander may prove annoying to the end user as they could potentially have sized the window to a preferred size.

_________________
Micah Carrick - Forum Administrator
http://www.micahcarrick.com


Top
 Profile  
 
 Post subject:
PostPosted: Tue Jun 05, 2007 11:48 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
If you get the height of the GtkExpander's child, then you could possibly just subtract that height from the height of the window when it is contracted. Then, do the same thing when it is expanded again. You have to do this because GTK+ will only resize the window after created unless necessary.

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 06, 2007 4:32 pm 
Offline

Joined: Thu Apr 12, 2007 7:35 pm
Posts: 3
Thanks for the suggestions. Making the window fixed works great with GtkExpander, however I would like the users to be able to resize the window. I tried Andrew's method of setting a new size based on the widow's size - child's size using gtk_window_resize(). Then I invalidate the window using gtk_widget_queue_draw_area(). However this has no effect. Is there a better way to get the window redrawn?


Top
 Profile  
 
 Post subject:
PostPosted: Wed Jun 06, 2007 9:32 pm 
Offline
Never Seen the Sunlight

Joined: Wed Sep 21, 2005 3:07 am
Posts: 384
Location: Fairfax, Virginia
gtk_widget_set_size_request()

_________________
Andrew Krause

Foundations of GTK+ Development: Buy now for only $31.49!


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

All times are UTC


Who is online

Users browsing this forum: Google Adsense [Bot] 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