1. wxEuphoria: get_next_tree_child() Returning 0 For All Child Items

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.

new topic     » topic index » view message » categorize

2. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items

euphoric said...

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

new topic     » goto parent     » topic index » view message » categorize

3. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items

Doing it that way, get_next_tree_child() still returns 0. Only get_first_tree_child() seems to be working. getlost

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... smile

new topic     » goto parent     » topic index » view message » categorize

4. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items

euphoric said...

Doing it that way, get_next_tree_child() still returns 0. Only get_first_tree_child() seems to be working. getlost

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... smile

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

new topic     » goto parent     » topic index » view message » categorize

5. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items

ghaberek said...
euphoric said...

Doing it that way, get_next_tree_child() still returns 0. Only get_first_tree_child() seems to be working. getlost

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... smile

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?

new topic     » goto parent     » topic index » view message » categorize

6. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items

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... grin

new topic     » goto parent     » topic index » view message » categorize

7. Re: wxEuphoria: get_next_tree_child() Returning 0 For All Child Items

ghaberek said...

I might have fixed this in a more recent build. Are you using my alpha4 build?

Thanks, Greg! It's working!

new topic     » goto parent     » topic index » view message » categorize

Search



Quick Links

User menu

Not signed in.

Misc Menu