mod/maxgui.mod/fltkmaxgui.mod/src/Fl_Tree.cxx
int Fl_Tree::select_only(Fl_Tree_Item *selitem, int docallback) {
  selitem = selitem ? selitem : first();	// NULL? use first()
  if ( ! selitem ) return(0);
  int changed = 0;
  for ( Fl_Tree_Item *item = first(); item; item = item->next() ) {
    if ( item == selitem ) {
      if ( item->is_selected() ) continue;	// don't count if already selected
      select(item, docallback);
      ++changed;
    } else {
      if ( item->is_selected() ) {
        deselect(item, docallback);
        ++changed;
      }
    }
  }
  return(changed);
}
/// Select only the specified \p item, deselecting all others that might be selected.
/// If item is 0, first() is used.
/// Handles calling redraw() if anything was changed.
/// Invokes the callback depending on the value of optional parameter \p docallback.
///
/// The callback can use callback_item() and callback_reason() respectively to determine 
/// the item changed and the reason the callback was called.
///
/// \param[in] selitem The item to be selected. If NULL, first() is used.
/// \param[in] docallback -- A flag that determines if the callback() is invoked or not:
///     -   0 - the callback() is not invoked
///     -   1 - the callback() is invoked for each item that changed state, 
///             callback_reason() will be either FL_TREE_REASON_SELECTED or 
///             FL_TREE_REASON_DESELECTED
///
/// \returns the number of items whose selection states were changed, if any.
///
Select only the specified \p item, deselecting all others that might be selected.
If item is 0, first() is used.
Handles calling redraw() if anything was changed.
Invokes the callback depending on the value of optional parameter \p docallback.

The callback can use callback_item() and callback_reason() respectively to determine
the item changed and the reason the callback was called.

\param[in] selitem The item to be selected. If NULL, first() is used.
\param[in] docallback -- A flag that determines if the callback() is invoked or not:
0 - the callback() is not invoked
1 - the callback() is invoked for each item that changed state,
callback_reason() will be either FL_TREE_REASON_SELECTED or
FL_TREE_REASON_DESELECTED

\returns the number of items whose selection states were changed, if any.
Select only the specified \ p item deselecting all others that might be selected . If item is 0 first () is used . Handles calling redraw () if anything was changed . Invokes the callback depending on the value of optional parameter \ p docallback . The callback can use callback_item () and callback_reason () respectively to determine the item changed and the reason the callback was called . \ param [ in ] selitem The item to be selected . If NULL first () is used . \ param [ in ] docallback -- A flag that determines if the callback () is invoked or not : 0 - the callback () is not invoked 1 - the callback () is invoked for each item that changed state callback_reason () will be either FL_TREE_REASON_SELECTED or FL_TREE_REASON_DESELECTED \ returns the number of items whose selection states were changed if any .
int Fl_Tree::select_only(Fl_Tree_Item *selitem, int docallback) {
  selitem = selitem ? selitem : first();	
  if ( ! selitem ) return(0);
  int changed = 0;
  for ( Fl_Tree_Item *item = first(); item; item = item->next() ) {
    if ( item == selitem ) {
      if ( item->is_selected() ) continue;	
      select(item, docallback);
      ++changed;
    } else {
      if ( item->is_selected() ) {
        deselect(item, docallback);
        ++changed;
      }
    }
  }
  return(changed);
}
int Fl_Tree :: select_only ( Fl_Tree_Item * selitem , int docallback ) { selitem = selitem ? selitem : first ( ) ; if ( ! selitem ) return ( 0 ) ; int changed = 0 ; for ( Fl_Tree_Item * item = first ( ) ; item ; item = item -> next ( ) ) { if ( item == selitem ) { if ( item -> is_selected ( ) ) continue ; select ( item , docallback ) ; ++ changed ; } else { if ( item -> is_selected ( ) ) { deselect ( item , docallback ) ; ++ changed ; } } } return ( changed ) ; }
Select only the specified \p item, deselecting all others that might be selected.
Select only the specified \ p item deselecting all others that might be selected .
// NULL? use first() // don't count if already selected