On Mon, 2010-07-12 at 12:02 +0200, donn wrote:
> > Sounds like a ClutterGroup, with an extra paint function. ClutterActors
> > are allowed to draw outside their allocation.
> I have attached a runnable demo of where I am at. The feedback I have 
> had so far indicates that it's really easy to do, and I have been 
> surprised by clutter before, but haven't solved it yet.
> 
> I think I may just put one group in another. The first will be the 
> backdrop (with an actual Rectangle actor) and the next will be for the 
> content. I should then be able to resize them both as needed.
> 

Easy:

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

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.


static void
_group_alloc_changed_cb (ClutterActor          *group,
                         ClutterActorBox       *box,
                         ClutterAllocationFlags flags,
                         ClutterActor          *bg_rect)
{
  clutter_actor_set_size (bg_rect,
                          box->x2 - box->x1,
                          box->y2 - box->y1);
}

g_signal_connect (my_group,
                  "allocation-changed",
                  (GCallback)_group_alloc_changed_cb,
                  my_background_rect);

Subclassing ClutterGroup is generally frowned upon.

Cheerio,

Rob





_______________________________________________
clutter-app-devel-list mailing list
[email protected]
http://lists.clutter-project.org/listinfo/clutter-app-devel-list

Reply via email to