I made some progress (figured out how to get the current node id) but I think I’m somehow calling the “leaffunc(t)” function wrong. I adapted it from this old code that created a button for each module: local dlg = {} for cat in pairs(cats) do for _,module in pairs(cats[cat]) do local modbtnfunc = module.bindsettings local modbtn = iup.button{title = module.label} modbtn.action = "" modbtnfunc(t) end --"t" is the current profile table, which gets passed to module.bindsettings(profile) table.insert(dlg, modbtn) end end Those buttons worked fine, but when I tried to adapt it into a tree, I couldn’t figure out how to write the equivalent of the “modbtn” line. The closest I can come is this: for cat in pairs(cats) do modtree.addbranch = cat --add a branch for each module category for _,module in pairs(cats[cat]) do --iter thru each category and populate branches with modules modtree.addleaf1 = module.label local leaffunc = module.bindsettings function modtree:executeleaf_cb(id) iup.Message(id,modtree.title) -- this works and gives me the module name and the node id leaffunc(t) --this doesn’t work and all leaves only open the same module end end end I tried a few ways of typing the function, but it didn’t work. How do I make it work like the button version? From: Antonio Scuri I suggest you to store in each node some information that will allow you to retrieve the correct module and be able to show it. Best, Scuri Em seg., 29 de nov. de 2021 às 23:11, Kaz F <kaz.fox...@gmail.com> escreveu:
_______________________________________________ |
_______________________________________________ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users