Jean-Baptiste Cazier wrote:

S�l !

I am porting my code from gtk1 to GTk2, ie pygtk 0.6 to 1.99 (quite painful btw)
I am stuck with the resizing manually of the window : everytime I resize the I want to 
update the drawing area it contains

I used to connect to size_allocate signal in pygtk 0.6
window.connect("size_allocate",self.area_resize)

But now this has the effect to call self_area_resize constantly

So I changed to configure_event, to only call area_resize after changes in sizes, window.connect("configure_event",self.area_resize)
But now the size allocation is not up-to date when I try to read it.
What is the correct signal to use in order to perform an operation based on the size of the window when it is resizing


Is there any more simpler way to catch the event that the window size is being changed by the mouse and obtain the new size ?


Connecting to the "size_allocate" is the right thing to do. The new allocation should be passed as an argument to your handler. Eg:
def area_size(self, widget, allocation):
print allocation.width, 'x', allocation.height


It shouldn't result in an infinite loop unless you are triggering a resize from your size_allocate handler (which would be a very bad thing to do).

James.

--
Email: [EMAIL PROTECTED]
WWW:   http://www.daa.com.au/~james/



_______________________________________________
pygtk mailing list   [EMAIL PROTECTED]
http://www.daa.com.au/mailman/listinfo/pygtk
Read the PyGTK FAQ: http://www.async.com.br/faq/pygtk/

Reply via email to