diff --git a/Fltk/onelabGroup.cpp b/Fltk/onelabGroup.cpp
index 02561263f29520dfa41a12c02922631f0329a62c..a7c8514eb57679bd563a607078fc70d6b7f8e468 100644
--- a/Fltk/onelabGroup.cpp
+++ b/Fltk/onelabGroup.cpp
@@ -529,6 +529,7 @@ void onelabGroup::_addParameter(T &p)
 void onelabGroup::_addMenu(const std::string &path, Fl_Callback *callback, void *data)
 {
   Fl_Tree_Item *n = _tree->add(path.c_str());
+  //n->labelsize(FL_NORMAL_SIZE + 4);
   _tree->begin();
   int ww = _baseWidth - (n->depth() + 1) * _indent;
   int hh = n->labelsize() + 4;
@@ -1019,6 +1020,11 @@ void onelabGroup::rebuildTree(bool deleteWidgets)
   _tree->sortorder(FL_TREE_SORT_ASCENDING);
   _tree->selectmode(FL_TREE_SELECT_NONE);
 
+  // hide all the widgets we have added in the tree to make sure they don't get
+  // spurious events (until they are deleted)
+  for(unsigned int i = 0; i < _treeWidgets.size(); i++)
+    _treeWidgets[i]->hide();
+
   // we don't delete widgets everytime the tree is rebuilt to minimize potential
   // race conditions (e.g. during heavy user interaction with autoCheck, with
   // risks to call handle() or focus() on deleted widgets)