Re: making tree with custom tree view dynamicaly (c++)

Neil <[email protected]>
Newsgroups gmane.comp.mozilla.devel.xpfe
Message-ID <[email protected]>
reverendlinux wrote:

>My problem was two fold.  There was one silly mistake where missed a comma in the getCellText portion of the function.  Surprisingly, this didn't throw an error.  I only found this, as stated in my last post, by going through the code line by line comparing mine to YuLo's.
>  
>
Weird. A missing semicolon I can understand, but a missing comma?

>However, the biggest roadblock was in my understanding of how the custom tree view works.  Through trial and error I figured out that I seemed to have been calling the view too soon in the execution of my script (the line document.getElementById(alphaList).view = treeView; in my original test code).  If I put all of my script into one function then called it from my XUL window, nothing appeared and no error was thrown.  When I split the var treeView piece into one function (called from the XUL window) and the .view piece into a separate function (called from the treeView function or the XUL window) it worked well.  After correcting the aforementioned comma oops of course.
>  
>
It's hard to tell from your description, but what might have happened is 
that setting the view calls various functions on the view which might 
not be ready, so to speak.

>As for the custom tree view documentation, well, for me it was only somewhat helpful; 3 out of 5 starts.  Again, this is coming from someone who is learning as he goes so my opinion is decidedly skewed. My trial and error coupled with referring back to the documentation did clue me in, but the docs were rather high level for me.  What would be most helpful to me and others learning the XUL/XPCOM/ Javascript ropes would be a line by line discussion of how the custom tree view code works.  For example, what exactly does isSorted: function(row){return false;}, do and what happens when you do things like change false to true.
>  
>
Which documentation are you referring to? The current documentation 
would have to be the nsITreeView page on MDN, although there is probably 
room for improvement. I notice that the isSorted documentation appears 
to be out of date though, the only place the value appears to be used is 
the painting code that prefills the CSS pseudoelement array used for 
matching against the CSS styles. (I don't know of any CSS that uses this.)

-- 
Warning: May contain traces of nuts.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.