Requesting TreeItem::removeItem
Posted: Sun Jun 15, 2008 13:38
I took notice of this project a short while ago (starting with 0.6.0 ^.^), and I am really impressed so far. But just now I wanted to implement a nice hierarchy browser using the CEGUI::Tree widget, and I hit a limitation: it seems TreeItem has currently no means of removing child items!
Lamentably, Tree and TreeItem do not have a unified interface with respect to their child items (sadly even for a generalized function using addItem() this also implies writing 2 functions with just different class names for the parameters / or possibly a template).
In any case, Tree has this remove functionality (Tree::removeItem() ) but it works only on TreeItems in the highest level, a call on a child-items will not remove anything (aside from the fact that this required some dirty const-removal casting and getOwnerWindow() abuse to even test this..).
Correct me if I am wrong and there is another, less obvious, way of removing child items! Otherwise, a TreeItem::removeItem(const TreeItem *item) would be really useful and needed for any decent tree implementation
Lamentably, Tree and TreeItem do not have a unified interface with respect to their child items (sadly even for a generalized function using addItem() this also implies writing 2 functions with just different class names for the parameters / or possibly a template).
In any case, Tree has this remove functionality (Tree::removeItem() ) but it works only on TreeItems in the highest level, a call on a child-items will not remove anything (aside from the fact that this required some dirty const-removal casting and getOwnerWindow() abuse to even test this..).
Correct me if I am wrong and there is another, less obvious, way of removing child items! Otherwise, a TreeItem::removeItem(const TreeItem *item) would be really useful and needed for any decent tree implementation