Changes between Version 40 and Version 41 of S3/S3Navigation


Ignore:
Timestamp:
03/05/12 20:56:51 (13 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Navigation

    v40 v41  
    4141             )
    4242           )
     43}}}
     44
     45You can use the call-method later to append more items:
     46
     47{{{
     48# Append another item to the menu
     49my_menu(MyMenuLayout("Third Item"))
     50}}}
     51
     52If you want to insert an item at a particular position, use the insert method:
     53
     54{{{
     55my_menu.insert(0, MyMenuLayout("New First Item"))
     56}}}
     57
     58You can also remove items from a certain position:
     59
     60{{{
     61my_menu.pop(0) # Remove "New First Item" again
     62}}}
     63
     64Note that every item can only ever belong to exactly one parent item. If you append or insert the same item to a different parent item, it will automatically be removed from the original parent:
     65
     66{{{
     67>>> menu_1 = M("Menu 1")
     68>>> menu_2 = M("Menu 2")
     69>>> item_1 = M("Item 1")
     70>>> menu_1.append(item_1)
     71<S3OptionsMenuLayout:Menu 1 {<S3OptionsMenuLayout:Item 1>}>
     72>>> menu_2
     73<S3OptionsMenuLayout:Menu 2>
     74>>> menu_2.append(item_1)
     75<S3OptionsMenuLayout:Menu 2 {<S3OptionsMenuLayout:Item 1>}>
     76>>> menu_1
     77<S3OptionsMenuLayout:Menu 1>
    4378}}}
    4479