On Sun, Feb 23, 2003 at 05:32:25PM +0800, James Henstridge wrote:
> >behavior of event objects in PyGTK2. The sample program below connects
> >to the button press, motion and release events and stores the event
> >object of the button_press event in an instance variable. In the motion
> >event handler the coordinates of the mouse in the saved press event are
> >always the same as the coordinates returned by get_pointer()! 
> >
> This is unfortunately unavoidable.  The event objects (and any other 
> boxed types for that matter) passed to the signal handle do no actually 
> own the underlying C object now (they use the same pointer as in the 
> GValue for the argument).  The object is not guaranteed to be valid 
> after the signal handler has finished running.  Copying the event object 
> is the correct way to handle this case.

Would it be correct, according to Python semantics, to pre-copy of
the object then? And if so, what are the drawbacks of implementing
things that way?

Take care,
--
Christian Reis, Senior Engineer, Async Open Source, Brazil.
http://async.com.br/~kiko/ | [+55 16] 261 2331 | NMFL
_______________________________________________
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