Hi, CuteAlien!
Thanks for checking this!
The background box &
the clip box get skrinked horizontally. I did not see it shrink vertically. The rendering of text is not affected except that it's getting clipped after a lots of calls to this has been made (it reduce each time
IGUIContextMenu::setItemText is invoked). This apply only to the submenu drawing.
Here in what circumstance I discovered the problem (if it really a problem...):
The way I'm using this is for creating a "view select" menu, where you have the "mainmenu" having the text describing the current view, and when clicking on it, you can select an alternative view from the "submenu" (perspective, left, right, front) AND it change the "main" menu description for the name of the currently selected view (Same way we do in 3DS Max, Lightwave, etc.) with the current viewport camera rendering.
Since a new release of IRRlicht should appear in some months, I thought it's should be a good idea to report this now and be sure it's not a bug. Is there a kind of "updateAbsolutePosition()" I should do when I'm modifying "live" (runtime) a menu item text? Perhaps I have to do this?
For my current project, it's not a real problem, first, this is for my hobby project (First King editor), the calculation after doing the
IGUIContextMenu::setItemText has been disabled temporary, and I added to the GUI, new features, as removing the background with the
setDrawBackground() method, added also the
setOverrideFont() and
setOverrideColor() methods (same method names as in IGUIStaticText) to the code. The IRRlicht code is so well written, it was really simple to implement this. Now I can define this for each menu/submenu independantly and it is now really more flexible for me for almost any kind of menus I would like to create.
EDIT: Here are screenshots that describe the problem:
Here is the new menu I'm making (The view and + are the main menu items)
Here at application startup:
![Image](http://www.clavet.org/files/images/errors/badmenu1.jpg)
Here after changing the view a couple of times (notice the submenu background as been reducted):
![Image](http://www.clavet.org/files/images/errors/badmenu2.jpg)
The box seem to stop shrinking when reaching that size.
If I find the problem with the calculation of width, I could post the whole component on the code snippet (or could propose it to the IRRext). I find it strange that the calculation is done properly before runtime, and when I use the
setItemText() at runtime suddenly the
clip box reduce horizontally...