aboutsummaryrefslogtreecommitdiff
path: root/dw/fltkui.cc
diff options
context:
space:
mode:
authorcorvid <corvid@lavabit.com>2011-01-23 02:35:01 +0000
committercorvid <corvid@lavabit.com>2011-01-23 02:35:01 +0000
commit5f55026c7f2e393749f65bbe6f284f76fabd6398 (patch)
treea604d5dfc3cd5cf81a7a915cfa3fb3f5e49925e0 /dw/fltkui.cc
parent1ed203635c66fe5373c5cff6e28faa7942ae8d5b (diff)
add tree items directly to a parent
When adding them by using a path argument, it wouldn't add duplicates with the same name. And maybe pushGroup and popGroup will resurface after all.
Diffstat (limited to 'dw/fltkui.cc')
-rw-r--r--dw/fltkui.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/dw/fltkui.cc b/dw/fltkui.cc
index 10c6889d..12089090 100644
--- a/dw/fltkui.cc
+++ b/dw/fltkui.cc
@@ -1004,7 +1004,8 @@ void FltkListResource::widgetCallback (Fl_Widget *widget, void *data)
void FltkListResource::addItem (const char *str, bool enabled, bool selected)
{
- Fl_Tree_Item *item = ((Fl_Tree *)widget)->add(str);
+ Fl_Tree *tree = (Fl_Tree *) widget;
+ Fl_Tree_Item *item = tree->add(tree->root(), str);
int index = itemsSelected.size ();
item->activate(enabled);