Learn how easy it is to sync an existing GitHub or Google Code repo to a SourceForge project! See Demo

Close

#796 Menu is not created if text on entry has more than 47 chars

ooDialog.4.2.0
closed
Mark Miesfeld
ooDialog (58)
5
2012-08-27
2009-08-25
Martin Berg
No

The menu is not created if one text has more than 47 characters.
The following code works fine, but if 47 is changed to 48 ore any higher value the menu is not created.
self~CreateMenu();
self~AddPopupMenu('Test')
self~AddMenuItem('Test1',221,,'TEST');
self~AddMenuItem('Test1'~Left(47,'*'),221,,'TEST');
self~AddMenuItem('Test2',222,'END','TEST');
self~AddMenuSeparator()
self~AddMenuItem('TestX',223,'END','TEST');

Discussion

  • Mark Miesfeld
    Mark Miesfeld
    2009-08-26

    The menu templates are created in memory, and in 3.2.0 I had people report to me that ooRexx crashed. This was due to them creating an in-memory template larger than allocated memory. For each menu item, the bulk of the memory used is for the text of the item, which is double-byte.

    To prevent the crashes I limit the amount of text for the menu item to 47 characters. This seemed more than enough. I looked at all the menus on my system and could not find any even close to 30 characters.

    This is fixed in trunk, where the new APIs made it easy to create a more robust Menu class. If the user attempts to add a menu item that would extend past allocated memory, a condition is raised. There has always been an option to specify a larger number of menu items than the default, so if the user hits that condition, they can specify that their menu needs more room. The restriction on the length of the text is lifted.

     
  • Mark Miesfeld
    Mark Miesfeld
    2010-02-24

    Committed revision 5619.

    For the 4.0.1 bug release, I eased up the restriction on the length of the menu item text to 64 characters. But the restriction on the length is still there. The real fix will have to be in the next release.

     
  • Mark Miesfeld
    Mark Miesfeld
    2010-09-08

    This fix will be in the next major release of ooDialog, but not in the 4.1.0 release.

     
  • Mark Miesfeld
    Mark Miesfeld
    2012-02-03

    This fix will appear in the next major release of ooDialog, it will not be included in an ooRexx bug fix release

     


Anonymous


Cancel   Add attachments