On 12/07/2010 15:36, Rob Bradford wrote:
Easy:
See?, everyone tells me this. :D

If you're using Clutter 1.3/1.4 then use the new constraints API:
http://docs.clutter-project.org/docs/clutter/1.3/ClutterBindConstraint.html
I wish. I am using Python so it's the 1.0 bindings. I use 1.3.6 under the hood, but the new stuff beyond gobject properties is not exposed yet. (Unless there's a way through said properties?)


If you're using 1.2 then you want to listen to the allocation-changed
signal on the group and then apply the width and height of the group to
your background rectangle.

I translated your C into Python. The Group connects it's 'allocation-changed' signal to a method in my Rectangle class. In there I get the ClutterActorBox box and — 1. It changes size ONLY if I add actors to the right/down of the Group's (0,0) point. i.e.:
 a. Actor ONE : set_position(0,0); grp.add(ONE)
 b. Actor TWO : set_position(200,200); grp.add(TWO)
2. It does *NOT* change the size if I do:
 a. Actor TWO : set_position(-200,0); grp.add(TWO)

So, getting the size of the Group via a box or get_size (or any other voodoo I have tried) does not suffice.

I am trying to use the Group as a space oriented from the center, so I think in terms of going left and up from (0,0) as well as down/right. (I have asked here previously about shifting (0,0) into the middle via matrixes like one can do in cairo, but I don't think Clutter works like this.)

(BTW, Attached to an earlier post in this thread is a runnable script to try demonstrate the problem.)

Subclassing ClutterGroup is generally frowned upon.
Oh dear, should I be implementing ClutterContainer instead?


Thanks Rob,
\d
_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to