On Thu, 2008-11-06 at 09:27 +0200, Michael Boccara wrote:
> Hi,
> 
> Is there a generic way, in clutter or in glib, to clone an actor ?
> The scenario is that I have an actor (any unknown subclass of actor), 
> which I want to duplicate several times (memcpy-like), with all its 
> current properties values, before setting some properties with specific 
> value for each clone.
> 
> I don't need a deep copy, i.e. I would just increment the ref count of 
> internal GObjects.

this is in direct contrast with what you're asking later:

> For example, I have a list actor whose role is to lay out a big list of 
> items I have a ClutterLtabel with "Times 16" as "font-name", and I want 
> to duplicate it 20 times and set a different text to each.

which is obviously impossible if you want to just increase the reference
count of the objects.

> I am quite pessimistic about the answers because I could not find a 
> ClutterActor::copy or even GObject::copy virtual functio which each 
> actor could override...

you can simply create a new actor setting all the properties at
construction time:


  copy = g_object_new (CLUTTER_TYPE_LABEL,
                       "text", clutter_label_get_text (orig),
                       "font-name", clutter_label_get_font_name (orig),
                       NULL);

ciao,
 Emmanuele.

-- 
Emmanuele Bassi, Intel Open Source Technology Center

-- 
To unsubscribe send a mail to [EMAIL PROTECTED]

Reply via email to