Gettng the size correct size of a GtkBox inside another GtkBox



Hello,

I don't know how common this is but I just couldn't find a good answer to it.
Here's my case:
In my application, the user can click a button in a list of items to
display further information to that item. But that is a quite common
task so I don't want to open a new window everytime the user wants to
look that information up for 5 seconds.
Also, the application window is designed to be pretty small. So what I
thougth is, I could just show the extra information in a GtkBox on the
right of the item list and make the window wider by exactly the size
the GtkBox is gonna take. This way, all the existing widgets would
stay in place(and the user could use the button he opened the extra
pane  with to close it again).
But all my attempts at implementing this have failed.
gtk_widget_get_preferred_width pretty much always returns 296(at least
in the cases I've tested it), gtk_widget_get_allocation gives me 1 for
the width, which isn't helpful either.
I also looked at the source code of Totem(which does just the same
thing when showing/hiding the sidebar) but it just seems to use
gtk_widget_get_allocation, but the widget they add is also no GtkBox
afaict(didn't look that up).

So: How can I solve that? Or does anyone know another open source
application that does just the same thing?


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]