Languages

Menu
Sites
Language
Cannot change text styled with EDC in a label

(follow-up to this post: https://developer.tizen.org/comment/26112#comment-26112)

After having styled the text with EDC styles, now i need to programmatically update this text, but if i keep the text attribute on the EDC component, it is ignoring any subsequent change, and if i remove that attribute, it doesn't display anything. 

I tried also to use 

elm_object_item_part_text_set, with the following part names:

  • custom
  • label2
  • default

But nothing is happening.

The EDC file i used is the following:

  collections 
{
   group 
   { 
      name: "elm/label/base/custom";
      parts 
      {
         text { "label2";
            scale: 1;
            desc { "default";
               color: 0 0 255 254;
               color2: 255 0 0 255;
               visible: 1;
               text {
                  size: 50;
                  font: "Sans";
                  text: "TEXT";
                  align: 0.5 0.5;
                  min: 0 0;
               }
               align: 0.5 0.5;
               rel1.relative: 0.25 0.25;
               rel2.relative: 0.75 0.75;
               map 
               {
                  on: 1;
                  rotation.z: 180;
                  perspective_on: 1;
                  backface_cull: 1;
               }
            }
         }  
      }
   }
}

So how to update that text?

View Selected Answer

Responses

1 Replies
Mark as answer
Ivan Gualandri

Finally i did it! :)

I managed to change the styled (rotated) text in the label. There was two problems, the first one is that the external text block needs an identifier like in the desc block. So it should became something like: 

text { 
        name: "label_test";
        scale: 1;
        desc { "default";
           color: 0 0 255 254;
            ...
            text { 
                ...
               }
               ...
            }
         }  

(i just omitted some of the content)

Then this has to be 

I was using the wrong function, instead of elm_object_item_part_text_set or elm_object_text_text i had to use the following:

elm_object_part_text_set(vc->label2, "label_test", "PSA");

Where the second argument is the name of the text block as defined above. 

With those changes now i can programmatically set the label content!