Page 1 of 1

Widget auto resize?

Posted: Tue Sep 13, 2011 00:37
by Mars_999
Hello I am new to CEGUI, and don't see in the Window class anything that allows me to specify the widget to resize itself... e.g. I have a button and the text is larger than the button. How can I have the button resize itself to hold the text?


BTW are there any really good sites with CEGUI tutorials? I see we have a wiki but looking for more examples... Or a complete setup of a menu system to learn from...

Re: Widget auto resize?

Posted: Wed Sep 14, 2011 20:37
by Jamarr
To my knowledge there is no mechanism as of yet for windows to resize themselves based on text / size changes of child windows. If it were, it would likely be handled by Layout Containers; I believe Kulik was going to add support for this in v0.8.

That being the case, you can manually resize the window after setting it's text by querying for the text-dimensions and resizing the parent accordingly. A search through the forums, wiki, and api docs should produce information on how to accomplish this.