RE: GtkTable and GtkDrawingArea




This message is a couple days old...  I'm suprised there isn't a reply yet, that I can see anyhow (hopefully 
I'm not missing messages).


I'm new to GTK and am having problems that I don't understand ...
thanks in advance to anyone who can take a look ...I'm trying to
use a GTKTable (created by Glade, and without any child widgets) to
lay out a group of GtkDrawingAreas. The table itself is 3x2 cells,
around 500x200 pixels, and homogeneous is set true.The problem is
that when I create a new GtkDrawingArea, attach it to a cell,  and
then make the GtkDrawingArea visible, the configure_event handler
seems to see that the GtkDrawingArea is only 1x1 ... it should be
something like 166x100.What could I be doing wrong??

I think it mentions that in the docs, but basically are you setting the size of the drawing area anywhere?

You either need to set a size directly on the widget (minimum size, requested size, whatever), or indirectly 
via a containing widget, which is more common.

One thing to watch, is the "fill" and "expand" settings when adding a widget to a container, which instruct 
the container to stretch your widget (if possible) to fit the space provided.  If you don't fill or expand 
your widget to fit the container (or the container to fit its container, for that matter), then the widgets 
(including containers themselves) go by their defaults, which will usually be as small as possible.  For 
example, a button will fit itself nice and neatly around the text and icons on its surface.  But a 
GtkDrawingArea has nothing to fit itself around, no "inside" to define its size by.  So it simply shivels up 
to 1x1.


Fredderic

_______________________________________________
Join Excite! - http://www.excite.com
The most personalized portal on the Web!





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