1. wxEuphoria: get_next_tree_child() Returning 0 For All Child Items
- Posted by euphoric (admin) Jul 17, 2018
- 1140 views
In the following code, get_next_tree_child() is always returning 0. That doesn't seem right.
-- user has selected a category; uninstall all forms in list atom cookie atom indx = get_tree_selection( tree_Templates ) -- get list of all items whose parent is indx integer child_count = get_tree_item_children_count( tree_Templates, indx, 0 ) list = get_first_tree_child( tree_Templates, indx ) cookie = list[2] list = {list[1]} for t=2 to child_count do child = get_next_tree_child( tree_Templates, indx, cookie ) --?child list = append(list, child ) end for
indx is a folder item.
It seems like I'm using those functions properly, but the results aren't what's expected.
2. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items
- Posted by ghaberek (admin) Jul 17, 2018
- 1147 views
In the following code, get_next_tree_child() is always returning 0. That doesn't seem right.
It seems like I'm using those functions properly, but the results aren't what's expected.
These first/next functions are basically iterators. That is, the "next" function gives elements until the list is exhausted, then it returns NULL. The consumer (you) doesn't need to know how many elements are in the list.
Do it like this:
-- user has selected a category; uninstall all forms in list atom indx = get_tree_selection( tree_Templates ) atom item, cookie sequence list = {} -- Euphoria 4.1 supports multiple assignments {item,cookie} = get_first_tree_child( tree_Templates, indx ) while item do list = append( list, item ) item = get_next_tree_child( tree_Templates, indx, cookie ) end while
-Greg
3. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items
- Posted by euphoric (admin) Jul 18, 2018
- 1087 views
Doing it that way, get_next_tree_child() still returns 0. Only get_first_tree_child() seems to be working.
I'm doing a work-around where I store the values of the children as they are created, then using that list instead of the iterator. There's gotta be a bug in there...
4. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items
- Posted by ghaberek (admin) Jul 18, 2018
- 1078 views
Doing it that way, get_next_tree_child() still returns 0. Only get_first_tree_child() seems to be working.
I'm doing a work-around where I store the values of the children as they are created, then using that list instead of the iterator. There's gotta be a bug in there...
I might have fixed this in a more recent build. Are you using my alpha4 build?
https://www.dropbox.com/s/5559jy6qiji59d4/wxEuphoria-0.17.0-win32-alpha4.zip?dl=1
-Greg
5. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items
- Posted by euphoric (admin) Jul 18, 2018
- 1073 views
Doing it that way, get_next_tree_child() still returns 0. Only get_first_tree_child() seems to be working.
I'm doing a work-around where I store the values of the children as they are created, then using that list instead of the iterator. There's gotta be a bug in there...
I might have fixed this in a more recent build. Are you using my alpha4 build?
https://www.dropbox.com/s/5559jy6qiji59d4/wxEuphoria-0.17.0-win32-alpha4.zip?dl=1
Not sure what version I'm using. The include file itself only shows up to 0.17.0.
Can I just drag-n-drop-replace the files in the ZIP you linked over what I currently have installed?
6. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items
- Posted by euphoric (admin) Jul 18, 2018
- 1033 views
Greg, line 7450 should be this:
c_proc( WX_SHOW_TABART_WINDOW_LIST, {tabArt,window,items,active_idx})
not this
c_proc( WX_SHOW_TABART_WINDOW_LIST, {tabArt,wnd,items,active_idx})
Or change the function definition parameters...
7. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items
- Posted by euphoric (admin) Jul 18, 2018
- 1050 views
I might have fixed this in a more recent build. Are you using my alpha4 build?
Thanks, Greg! It's working!