How to get the width of a wide indefinite Label?

hello, do not speak English, that I translated with google translator.
my question is: how do I get the width of a Label that I have established with the method setSizeUndefined (), this is what I did, but I always returns 0 or -1:

[font=Courier New]
Label texto = new Label(msj, 3);
texto.setSizeUndefined();
float ancho = texto.getWidth();

[/font]

also wanted to know if there any component like timepicker where only select the hour, minutes and seconds and not the date

thank you very much for your help

hola, no hablo ingles, esto lo traduje con el traductor de google.
mi pregunta es: como obtengo el ancho de un componente Label que le he establecido con el metodo setSizeUndefined(), esto es lo que he hecho, pero siempre me retorna 0 o -1:


Label texto = new Label(msj, 3);
texto.setSizeUndefined();
float ancho = texto.getWidth();

tambien queria saber si existe algun componente parecido al timepicker donde solo se seleccione la hora, minutos y segundos y no la fecha

muchas gracias por su ayuda

Hi,

The actual width of the Label is never returned back to the server, so there’s no (easy) way of accessing it. -1 that is returned by getWidth() essentially means undefined.

I am not aware of any time picker add-on, but you could could quite easily create one yourself using a couple of native selects.

The
CSS Tools add-on
has a RenderInfo class that you can use to get the exact pixel size of a component.