GTK+ Forums Forum Index GTK+ Forums
Discussion forum for GTK+ and Programming. Ask questions, troubleshoot problems, view and post example code, or express your opinions.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

GtkExpander help

 
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming
Author Message
joshl



Joined: 12 Apr 2007
Posts: 3

PostPosted: Tue Jun 05, 2007 9:01 pm    Post subject: GtkExpander help Reply with quote

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?
Back to top
Micah Carrick
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 480
Location: Portland, OR USA

PostPosted: Tue Jun 05, 2007 11:45 pm    Post subject: Reply with quote

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.
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 386
Location: Fairfax, Virginia

PostPosted: Tue Jun 05, 2007 11:48 pm    Post subject: Reply with quote

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.
Back to top
joshl



Joined: 12 Apr 2007
Posts: 3

PostPosted: Wed Jun 06, 2007 4:32 pm    Post subject: Reply with quote

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?
Back to top
openldev
Never Seen the Sunlight


Joined: 21 Sep 2005
Posts: 386
Location: Fairfax, Virginia

PostPosted: Wed Jun 06, 2007 9:32 pm    Post subject: Reply with quote

gtk_widget_set_size_request()
Back to top
Display posts from previous:   
Post new topic   Reply to topic    GTK+ Forums Forum Index -> GTK+ Programming All times are GMT
Page 1 of 1

 


Powered by phpBB © 2001, 2005 phpBB Group
CodeBB 1.0 Beta 2
Protected by Anti-Spam ACP