Re: [gtk-list] Size of widgets



Chris Sherlock <gtk_au@yahoo.com> writes: 
> I can get the size of the widget *after* I show the
> window, but I want to create a border around the table
> cells using the GDK *before* the table and window is
> displayed!

You can't just draw on widgets, it won't work properly even if you get
the size.

If you want a border around each widget in a table, the best way to do
it is to write a simple subclass of GtkBin that draws such a
border. This widget should be absolutely trivial; override
size_request to return the size of the child plus the size of your
border, override size_allocate to give the child your allocation minus
the size of the border, override expose/draw to draw your border and
then chain up to the GtkBin default implementations of expose/draw to
draw the child widget. That should be it, maybe I forgot a couple
details. Anyway GtkObject boilerplate plus 4 or so trivial functions.

Havoc




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