diff options
Diffstat (limited to 'FL/Fl_Tree_Item_Array.H')
| -rw-r--r-- | FL/Fl_Tree_Item_Array.H | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/FL/Fl_Tree_Item_Array.H b/FL/Fl_Tree_Item_Array.H index a8de00dcc..802381f7f 100644 --- a/FL/Fl_Tree_Item_Array.H +++ b/FL/Fl_Tree_Item_Array.H @@ -49,6 +49,12 @@ class FL_EXPORT Fl_Tree_Item_Array { int _total; // #items in array int _size; // #items *allocated* for array int _chunksize; // #items to enlarge mem allocation +#if FLTK_ABI_VERSION >= 10303 + enum { + MANAGE_ITEM = 1, ///> manage the Fl_Tree_Item's internals (internal use only) + }; + char _flags; // flags to control behavior +#endif void enlarge(int count); public: Fl_Tree_Item_Array(int new_chunksize = 10); // CTOR @@ -83,6 +89,17 @@ public: void insert(int pos, Fl_Tree_Item *new_item); void remove(int index); int remove(Fl_Tree_Item *item); +#if FLTK_ABI_VERSION >= 10303 + /// Option to control if Fl_Tree_Item_Array's destructor will also destroy the Fl_Tree_Item's. + /// If set: items and item array is destroyed. + /// If clear: only the item array is destroyed, not items themselves. + void manage_item_destroy(int val) { + if ( val ) _flags |= MANAGE_ITEM; else _flags &= ~MANAGE_ITEM; + } + int manage_item_destroy() const { + return _flags & MANAGE_ITEM ? 1 : 0; + } +#endif }; #endif /*_FL_TREE_ITEM_ARRAY_H*/ |
