[archived content]
Dfl /

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.

DescriptionOld BehaviorNew Behavior
MenuItem.index init value0-1
MenuItem.index = n; n before adding to another menun-1
MenuItem.index after adding (menuItems.add)previous MenuItem.indexend of menuItems
MenuItem.index after inserting (menuItems.insert)specified insert indexspecified insert index
MenuItem.index after removing from parent menusame MenuItem.index-1
Appending to menuItems with opCatAssign/~=Insert at end of menuItemsdeprecated

Page last modified on March 04, 2007, at 09:33 PM