Change Widget size

So… I want to change the size of my widget, a PtLabel, according to the size of the text in this widget
Is there a function to do that?
I can’t find it …


Try to set the Pt_ARG_REESIZE_FLAGS to …_AS_REQUIRED (which is default) or to …_ALWAYS (this will also make your widget smaller if the text gets shorter).

Thank you for your answer!
But I think I’ve not choose a good example with a PtLabel,
The problem in fact is that I want all my widgets sizes to change according to the texts sizes (PtLabel, PtButton, PtMultiText, PtGroup…)
Probably, there is no function to do that … I will try in another way…
If someone has another idea…

The resize-thing should work for all widgets derrived from PtLabel.

You can also set Pt_ARG_DIM manually for your widgets.

You should have a look at the PfExtentText() function, it can be used to calculate the size that is actually needed for a certain text.

Some information about Widget geometry may also be helpfull.