Adding items to menus was fairly illogical and was updated in DFL 0.9.5.
If too much of your code depends on the old behavior of menus, you can call Menu.setDFL092()
before creating menus and the old usage (Old Behavior) will be reverted. This function requires compiling with the -d
compiler switch.
The below table illustrates the changes.
Description | Old Behavior | New Behavior |
MenuItem.index init value | 0 | -1 |
MenuItem.index = n; n before adding to another menu | n | -1 |
MenuItem.index after adding (menuItems.add ) | previous MenuItem.index | end of menuItems |
MenuItem.index after inserting (menuItems.insert ) | specified insert index | specified insert index |
MenuItem.index after removing from parent menu | same MenuItem.index | -1 |
Appending to menuItems with opCatAssign /~= | Insert at end of menuItems | deprecated |