I just found out that subclassing *does* work the old way, except for
classes that need arguments in their constructors, which Clutter.Box
does (layout_manager). It seems one cannot reuse constructors from
superclasses (without tangling with meta classes), so my current
workaround is to mimic the superclass's behaviour in my own
constructor, which is instance bound (__init__), not class bound like
Box.new():

class MyBox(clutter.Box):

    def __init__(self, layout):
        super(Map, self).__init__()
        self.set_layout_manager(layout)

Hm, maybe a better approach is available...

bw,
Martin


On 6 September 2011 13:16, Martin Voigt <[email protected]> wrote:
> Hey *,
>
> I'm using clutter from git (head), compiled with
> --enable-introspection. Everything works fine in python, except that
> I'm unable to subclass anything. With the old pyclutter this was quite
> easy, but now I'm at a dead end. Since live.gnome.org is down for days
> I cannot look up the documentation for gir and python, and every
> google search I do seem to lead to live.gnome.org ;(
>
> Could anyone provide me with a simple example of, say, subclassing 
> Clutter.Box?
>
> Thanks in advance,
> Martin
>
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to