Emmanuele Bassi wrote:
On Thu, 2008-11-06 at 09:27 +0200, Michael Boccara wrote:
  
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.
  
Sorry I didn't explain myself well.
It is the label I want to duplicate 20 times, not the parent actor.
  
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);
  
The problem is that I don't know what properties differ from default.
The code I would be rather looking for is, suposing a g_object_duplicate function would exist:

ClutterLabel* label = g_object_new (CLUTTER_TYPE_LABEL,
                                    "text", "my text",
                                    "font-name", "Sans serif 16",
                                    NULL);
// another segment of code
clutter_label_set_line_wrap(label, true);

// another segment of code
// this would also copy the line_wrap flag
ClutterLabel* label2 = CLUTTER_LABEL(g_object_duplicate(label));

Thanks,

Michael

  
ciao,
 Emmanuele.

  


-- 
Michael Boccara
Graphtech
Herzliya, Israel

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

Reply via email to