gtk_ctree_insert_gnode bug?!



I have been working with this function, and noticed a strange problem.
Say, I make a gnode with a couple thousand nodes. Out of these couple
thousand nodes I need to make a ctree, but only using certain nodes of the
gnode. (Think directory structure with dirs + files, and I want to make a
ctree out of dirs only).

So, say I already have a ctree with some stuff in it:

+ slack
+ stuff
+ last_one

All is well, and I have my gnode and my ctree. Next step is to add a new
gnode, after "last_one".

So I do something like:

gtk_ctree_insert_gnode(ctree, NULL, NULL, gnode, gnode_to_ctree, data);

visually the tree should look something like:
+ slack
+ stuff
+ last_one
+ new_one_i_just_inserted

Instead, it looks the same (ctree is "frozen"). A quick printf on the
clist->freeze_count shows an interesting problem.

gnode_to_ctree does all the usual stuff, and returns "TRUE" for gnodes of
"directory" type, and sets the tree data, and returns FALSE for all the
other types. The problem is that when I return "FALSE" for the
non-processed entries, the ctree freeze count isnt decremented. So after
inserting a few 10000 item gnodes with maybe few thousand entries actually
inserted into the ctree, I end up with a clist->freeze_count of a few
thousand.

Is this a "known feature"?
Should it be fixed?

My temporary solution is simply doing a gtk_clist_thaw(clist); before
returning FALSE from my gnode function, though I am sure that isn't quite
the best way to do it.

I am not on the list so please CC: any replies to me.

thanks
tim

-- 
・‥…━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━…‥・
     timecop at japan.co.jp | OA通信サービス株式会社 | NTT DoCoMo
  I thought everything that Linus Torvalds is involved with was divine
  perfection? Must be a problem with NEC and Sony -about Crusoe recall
・‥…━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━…‥・


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]