Homework progress

This commit is contained in:
Jan-Niclas Loosen
2025-10-18 15:35:07 +02:00
parent 081a7132fc
commit ee97bf1518
3 changed files with 99 additions and 36 deletions

View File

@@ -91,7 +91,13 @@ class MaMaGUI:
if len(macros) > len(opened_macros):
parent_depth = len(macros) - 1
header_indent = " " * parent_depth + " " * macro_offset
self.prog_list.insert(tk.END, f"{header_indent}[{macros[-1]}]")
macro = macros[-1]
if isinstance(macro, dict):
params = ", ".join(f"{k}={v}" for k, v in macro.get("params", {}).items())
header = f"{macro['name']}({params})" if params else macro["name"]
else:
header = str(macro)
self.prog_list.insert(tk.END, f"{header_indent}[{header}]")
self.prog_list.itemconfig(tk.END, {"bg": "#e6e6e6"})
instr_indent = " " * depth