On Mon, Feb 08, 2010 at 08:20:27PM +0200, donn wrote: > On 08/02/2010 10:25, Bastian Winkler wrote: > >either by adding a __gtype_name__ to your class > >or calling gobject.type_register(). Your 'do_paint' method should be > >called correctly after that. > Ah, that was the magic. Many thanks. You're welcome
> I attach the sample code for posterity. There are a few questions
> within the code which would be nice to have answered (to do with
> signals on the Group subclass.)
<...>
> # Trying to catch motion-event in this class. It complains that
> # "signal "motion_event" already exists in the `ClutterActor' class ancestry"
> #__gsignals__ = {'motion-event' : (gobject.SIGNAL_RUN_LAST,
> gobject.TYPE_NONE, ())}
You're trying to create a new signal here, but as a subclass of
clutter.Actor the group already defines a signal with that name.
>
> def __init__(self,w,h):
> clutter.Group.__init__(self)#,*args)
> self.width, self.height = w, h
> #self.connect('motion-event', self.do_motion_event) # Does
> nothing :(
Connecting a callback to the ::motion-event signal is the right thing to
do, but an actor needs to be reactive in order to emit pointer events [1].
self.set_reactive(True)
<...>
so long
:wq buz
[1] http://clutter-project.org/docs/clutter/stable/ClutterActor.html
--
Life's unfair - but root password helps!
GnuPG Fingerprint: 2FFF FC48 C7DF 1EA0 00A0 FD53 8C35 FD2E 6908 7B82
signature.asc
Description: Digital signature
