wxPython/wxGlade-0.9.1/widgets/menubar/menubar.py
def add_items(self, menus):
        """adds the content of 'menus' to self.menu_items. menus is a sequence of
        trees which describes the structure of the menus"""
        indent = " " * 4
        if compat.IS_CLASSIC:
            set_item = self.menu_items.SetStringItem
            add_item = self.menu_items.InsertStringItem
        else:
            set_item = self.menu_items.SetItem
            add_item = self.menu_items.InsertItem
        index = [0]

        def add(node, level):
            i = index[0]
            add_item(i, misc.wxstr(indent * level + node.label.lstrip().replace("\t","\\t")))
            set_item(i, 1, misc.wxstr(node.handler))
            set_item(i, 2, misc.wxstr(node.name))
            set_item(i, 4, misc.wxstr(node.help_str))
            set_item(i, 5, misc.wxstr(node.id))
            if node.label==node.name==node.id=='---':
                set_item(i, 3, '')
            else:
                item_type = 0
                try:
                    if node.checkable and int(node.checkable):
                        item_type = 1
                    elif int(node.radio):
                        item_type = 2
                except ValueError:
                    pass
                set_item(i, 3, misc.wxstr(item_type))
            index[0] += 1
            for item in node.children:
                add(item, level+1)
        for tree in menus:
            add(tree.root, 0)
        if self.menu_items.GetItemCount():
            self._enable_fields()
adds the content of 'menus' to self.menu_items. menus is a sequence of
        trees which describes the structure of the menus
adds the content of 'menus' to self.menu_items. menus is a sequence of
trees which describes the structure of the menus
adds the content of ' menus ' to self . menu_items . menus is a sequence of trees which describes the structure of the menus
def add_items(self, menus):
        indent = " " * 4
        if compat.IS_CLASSIC:
            set_item = self.menu_items.SetStringItem
            add_item = self.menu_items.InsertStringItem
        else:
            set_item = self.menu_items.SetItem
            add_item = self.menu_items.InsertItem
        index = [0]
        def add(node, level):
            i = index[0]
            add_item(i, misc.wxstr(indent * level + node.label.lstrip().replace("\t","\\t")))
            set_item(i, 1, misc.wxstr(node.handler))
            set_item(i, 2, misc.wxstr(node.name))
            set_item(i, 4, misc.wxstr(node.help_str))
            set_item(i, 5, misc.wxstr(node.id))
            if node.label==node.name==node.id=='---':
                set_item(i, 3, '')
            else:
                item_type = 0
                try:
                    if node.checkable and int(node.checkable):
                        item_type = 1
                    elif int(node.radio):
                        item_type = 2
                except ValueError:
                    pass
                set_item(i, 3, misc.wxstr(item_type))
            index[0] += 1
            for item in node.children:
                add(item, level+1)
        for tree in menus:
            add(tree.root, 0)
        if self.menu_items.GetItemCount():
            self._enable_fields()
def add_items ( self , menus ) : indent = " " * 4 if compat . IS_CLASSIC : set_item = self . menu_items . SetStringItem add_item = self . menu_items . InsertStringItem else : set_item = self . menu_items . SetItem add_item = self . menu_items . InsertItem index = [ 0 ] def add ( node , level ) : i = index [ 0 ] add_item ( i , misc . wxstr ( indent * level + node . label . lstrip ( ) . replace ( "\t" , "\\t" ) ) ) set_item ( i , 1 , misc . wxstr ( node . handler ) ) set_item ( i , 2 , misc . wxstr ( node . name ) ) set_item ( i , 4 , misc . wxstr ( node . help_str ) ) set_item ( i , 5 , misc . wxstr ( node . id ) ) if node . label == node . name == node . id == '---' : set_item ( i , 3 , '' ) else : item_type = 0 try : if node . checkable and int ( node . checkable ) : item_type = 1 elif int ( node . radio ) : item_type = 2 except ValueError : pass set_item ( i , 3 , misc . wxstr ( item_type ) ) index [ 0 ] += 1 for item in node . children : add ( item , level + 1 ) for tree in menus : add ( tree . root , 0 ) if self . menu_items . GetItemCount ( ) : self . _enable_fields ( )
adds the content of 'menus' to self.menu_items.
adds the content of ' menus ' to self . menu_items .
"""adds the content of 'menus' to self.menu_items. menus is a sequence of
        trees which describes the structure of the menus"""
self
menus