How to get the current width of Label ?

I have create the Label in XML.


<Label
  id="testLabel"
  font="font:MediumBoldSystemFont"
  text = "Application Development Made Easy!"
  horizAlign = "left"
  vertAlign = "center"
  translation="[10,10]" />

How to get the width of label during run time, if text of this label is changed randomly.
Thanks.

You can use the ifSGNodeBoundingRect functions on the label: https://sdkdocs.roku.com/display/sdkdoc/ifSGNodeBoundingRect