Hierarchical list widget error?
LTKunneman
To make the listbox:
Function ErrorHierarchicalList() String Swinname="WindowDataHierarchy" String Slistboxname="HierarchicalListbox" Dowindow/K $(Swinname) NewPanel /N=$(Swinname) /W=(1000,100,1250,460) as "Data gestructureerd" Make /O/T WhierarchyItems Make/O WhierarchySel ListBox $(Slistboxname),ListWave=WhierarchyItems,size={235,315},pos={5,30},widths={30,185} ListBox $(Slistboxname),fsize=15,mode=4,SelWave=WhierarchySel MakeListIntoHierarchicalList(Swinname,Slistboxname,"ContainerOpenFamOrFolder") end
To get the error, execute:
ErrorHierarchicalList() WMHL_AddObject("WindowDataHierarchy","HierarchicalListbox","","item 1",1) WMHL_DeleteRowAndChildren("WindowDataHierarchy","HierarchicalListbox",0) WMHL_AddObject("WindowDataHierarchy","HierarchicalListbox","","item 1",1)
Am I making a basic mistake?
(ps, edit: the error is: "While executing a wave write, the following error occured: Index out of range for wave "Selwave".)
I started digging in the procedure file of the hierarchical listwidget, and I think I have the root of the trouble: if the LB is initialized, but all rows are killed, then the number of columns and layers of SelWave and ListWave are also reduced to zero. Changing the function WMHL_AddObjectToList solved the error, but I don't know if I introduced other errors as well. (When extra columns are used e.g.) Some advice please!
Change to WMHL_AddObjectToList:
October 22, 2013 at 04:48 am - Permalink
Just as a side note- ErrorHierarchicalLis() makes a listwave and selwave for the listbox, but that's not needed. MakeListIntoHierarchicalList() creates waves private to HierarchicalListWidget, abandoning the waves you created. The only things you need to do with the listbox are to create it and give it a size and position.
I'll let you know what I figure out.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
October 22, 2013 at 09:30 am - Permalink
This fix will be included in the next minor release of Igor, but I don't know when that might be. I don't want to post the revised procedure file here because then it will have an indefinite life. I would be happy to send you a copy if you send an e-mail to support@wavemetrics.com.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
October 22, 2013 at 10:46 am - Permalink
edit: as I typed this reply, you posted the fix. I replaced "WMHL_DeleteRowAndChildren" by your function, and it works! Thank you so much for the fantastic service.
October 22, 2013 at 10:56 am - Permalink
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
October 22, 2013 at 11:06 am - Permalink
The current fix of reinitialization seems to kill color support as well, I have to add it after removing the last item.
November 4, 2013 at 11:06 am - Permalink
Perhaps if we need to continue, we should handle this via support@wavemetrics.com.
John Weeks
WaveMetrics, Inc.
support@wavemetrics.com
November 5, 2013 at 09:45 am - Permalink