[pygtk] size_request and size_allocate

Pupeno pupeno at pupeno.com
Fri Jan 6 09:39:31 WST 2006


On Thursday 05 January 2006 11:43, Gustavo J. A. M. Carneiro wrote:
> Qui, 2006-01-05 às 10:16 -0300, Pupeno escreveu:
> > I am implementing a widget (a copy of Writing a Widget Using Cairo and
> > PyGTK 2.8) and the size of my widget is terrible (it gets 0 space), so I
> > implemented size_request and size_allocate, but they are never called,
> > why aren't they called ? How should my widget ask for more size ?
> > Thanks.
>
>   This example might help, if you have pygtk 2.8:
>
>  http://telecom.inescporto.pt/~gjc/higcontainer/higcontainer.py

Yes, this really really helped me! :) Thank you.

As I said before, my widget is based on gtk.DrawingArea. I implemented 
do_size_request(self, requisition) but it wasn't called until I've set 
__gtype_name__ = 'EggClockFace' on the class, anybody knows why ?

Can anybody tell me if this line of thought is ok: do_size_allocate() is in 
charge of receiving a 'size' and allocating of that size space for each of 
the sub-widgets, but in my case I don't have any subwidgets, everything is 
done in draw() so I con get along without implementing do_size_allocate(), 
right ?

Thank you.
-- 
Pupeno <pupeno at pupeno.com> (http://pupeno.com)
Vendemos: Conocer y collecionar Monedas y Billetes de Todo el Mundo: 
http://pupeno.com/vendo/#monedas
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://www.daa.com.au/pipermail/pygtk/attachments/20060105/a72d2f73/attachment.pgp


More information about the pygtk mailing list