Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Can text in FXLabel automatically wrap if there is more text than the widget can hold?

0
Posted

Can text in FXLabel automatically wrap if there is more text than the widget can hold?

0

No. Wrapping requires the getHeightForWidth() or getWidthForHeight() API’s, and these require that one of the widget’s dimensions be known. However, this is generally not possible for widgets that are nested deep down in the widget tree. At the top level [e.g. with the toolbars], we *can* use these API’s since the constraint of the main window’s size is directly known. Due to pretty sophisticated recursive layout procedures, we must insist that one thing be true at all times and that is that getDefaultWidth() and getDefaultHeight() always returns the same answer [the answer may be based on the contents, but for a given contents the answer must always be the same]. For a wrapped FXLabel, the width would determine the height, and possibly vice-versa. This would violate the assumption.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.