Changes between Version 41 and Version 42 of S3/S3Navigation


Ignore:
Timestamp:
03/05/12 20:59:48 (10 years ago)
Author:
Dominic König
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • S3/S3Navigation

    v41 v42  
    6565
    6666{{{
    67 >>> menu_1 = M("Menu 1")
    68 >>> menu_2 = M("Menu 2")
    69 >>> item_1 = M("Item 1")
    70 >>> menu_1.append(item_1)
     67# CLI example
     68>>> menu_1 = M("Menu 1")  # define menu 1
     69>>> menu_2 = M("Menu 2")  # define menu 2
     70>>> item_1 = M("Item 1")  # define a menu item
     71>>> menu_1.append(item_1) # append the menu item to menu 1
    7172<S3OptionsMenuLayout:Menu 1 {<S3OptionsMenuLayout:Item 1>}>
    7273>>> menu_2
    7374<S3OptionsMenuLayout:Menu 2>
    74 >>> menu_2.append(item_1)
     75>>> menu_2.append(item_1) # append the menu item to menu 2
    7576<S3OptionsMenuLayout:Menu 2 {<S3OptionsMenuLayout:Item 1>}>
    7677>>> menu_1
    77 <S3OptionsMenuLayout:Menu 1>
    78 }}}
     78<S3OptionsMenuLayout:Menu 1> # => menu item no longer component of menu 1
     79}}}
     80
     81Thus, if you want to re-use a sequence of menu items, make their definition a function and call it at each place you need the sequence.
    7982
    8083Each navigation item can receive any number of keyword parameters.