(self, text)
return toc
Create table of contents as drop-down menu.
Create table of contents as drop-down menu.
Create table of contents as drop - down menu .
def toc_menu(self, text):
        "Create table of contents as drop-down menu."
        toc = Menubutton(self, text='TOC')
        drop = Menu(toc, tearoff=False)
        for lbl, dex in text.parser.toc:
            drop.add_command(label=lbl, command=lambda dex=dex:text.yview(dex))
        toc['menu'] = drop
        return toc
def toc_menu ( self , text ) : toc = Menubutton ( self , text = 'TOC' ) drop = Menu ( toc , tearoff = False ) for lbl , dex in text . parser . toc : drop . add_command ( label = lbl , command = lambda dex = dex : text . yview ( dex ) ) toc [ 'menu' ] = drop return toc