remove unused code
parent
603acb60f6
commit
cb9770f57e
|
@ -1,4 +1,3 @@
|
||||||
import tkinter as tk
|
|
||||||
import util
|
import util
|
||||||
|
|
||||||
|
|
||||||
|
@ -67,18 +66,3 @@ menu_structure = {
|
||||||
|
|
||||||
#FIXME: come up with a way to uniquely declare separators so they don't become the same element of a dict
|
#FIXME: come up with a way to uniquely declare separators so they don't become the same element of a dict
|
||||||
|
|
||||||
def build_menu(structure_dict, menu):
|
|
||||||
for entry in structure_dict:
|
|
||||||
if structure_dict[entry]==None:
|
|
||||||
if entry==None:
|
|
||||||
menu.add_separator()
|
|
||||||
else:
|
|
||||||
menu.add_command(label=entry)
|
|
||||||
menu.entryconfig(entry, state="disabled")
|
|
||||||
if isinstance(structure_dict[entry], dict):
|
|
||||||
submenu = tk.Menu(menu, tearoff=False)
|
|
||||||
build_menu(structure_dict[entry], submenu)
|
|
||||||
menu.add_cascade(label=entry, menu=submenu)
|
|
||||||
if callable(structure_dict[entry]):
|
|
||||||
menu.add_command(label=entry, command=structure_dict[entry])
|
|
||||||
|
|
||||||
|
|
Reference in New Issue