[sword-devel] Tree container

Victor Porton sword-devel@crosswire.org
Mon, 03 Jun 2002 06:26:06 +0600


> 	We currently have a treekey class that will do this.  Not sure exactly 
> what you are trying to do, but maybe we could give some advice, if you 
> give us the details.

I need to display a tree widget in the UI (one tree for every Hebrew word), every item of the tree refers to a grammatical form or a class of grammatical forms. For this is need to generate a tree data structure in Sword (or alternatively, as I said above, use virtual functions or callbacks to generate the tree). When user clicks an item in the tree, the UI will display the corresponding entry or several entries which I am going to get from an LD.

It isn't simple, e.g. user may reorder items in the tree by a special widget (in fact after user interaction with this widget the tree will be regeberated anew by Sword with an other order of items), not simple to explain etc.

So I need to attach a data structure to each item (not just a key). By this data structure several keys will be generated and used for getting the entries from a LD.

TreeKeyIdx (the only non-virtual class derived from TreeKey I found) is too specialized for this. May be I should use a simpler class? Or virtual functions or callbacks?
-- 
Victor Porton (porton@narod.ru)