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: > I’m trying to populate a tree with the names of modules (leaves) so when > you double-click on the name, the module dialog should pop up. > > It almost works, but for some reason, every leaf opens the same module. > How can I fix that? > > This is the part of the code I have: > > > > local modtree = iup.flattree{rastersize = "400x500"} --are there any > more-flexible options than rastersize? > > modtree["addbranch-1"] = "MODULES" --add root node > > > > for cat in pairs(cats) do > > modtree.addbranch = cat --add a branch for each module > category > > for _,module in pairs(cats[cat]) do --populate branches > with modules > > modtree.addleaf1 = module.label > > function modtree:executeleaf_cb() > module.bindsettings(t) end > > end > > end > > > > Each module script starts with this code: > > > > local module = {} > > function module.bindsettings(profile) > > …contains code about the dialog > _______________________________________________ > Iup-users mailing list > Iup-users@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/iup-users >
_______________________________________________ Iup-users mailing list Iup-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/iup-users