Create table of contents as drop-down menu.
(self, text)
| 227 | scroll.grid(row=0, column=2, sticky='ns') |
| 228 | |
| 229 | def toc_menu(self, text): |
| 230 | "Create table of contents as drop-down menu." |
| 231 | toc = Menubutton(self, text='TOC') |
| 232 | drop = Menu(toc, tearoff=False) |
| 233 | for lbl, dex in text.parser.toc: |
| 234 | drop.add_command(label=lbl, command=lambda dex=dex:text.yview(dex)) |
| 235 | toc['menu'] = drop |
| 236 | return toc |
| 237 | |
| 238 | |
| 239 | class HelpWindow(Toplevel): |
no test coverage detected