Re: [ROOT] TList enhancement suggestion

From: Brett Viren (bv@bnl.gov)
Date: Fri Nov 16 2001 - 14:55:46 MET


Hi,

It would cause circular dependencies and break the modularity of ROOT.

However, I dont see any need for a "this" in your FindWidget method.
Instead of a method it could be a regular old stand alone function
(anyone remember subroutines?)  with both the list and the id passed
in.  It could then go in TGWidet.{cxx,h}.

-Brett.

Thomas Bretz writes:
 > Hi all,
 > 
 > how about a enhancement of TList?
 > 
 > -------------------------------------------------------
 > TObject *TList::FindWidget(Int_t id) const
 > {
 >  if (id<0)
 >    return NULL;
 > 
 >  TObject *obj;
 >  TIter Next(this);
 >  while ((obj=Next()))
 >  {
 >    const TGWidget *wid =
 > (TGWidget*)obj->IsA()->DynamicCast(TGWidget::Class(), obj);
 >    if (!wid)
 >      continue;
 > 
 >    if (id == wid->WidgetId())
 >      return obj;
 >  }
 >  return NULL;
 > }
 > --------------------------------------------------------
 > 
 > If you use a TList to order GUI elemets this could sometimes be very
 > usefull.
 > 
 > Best regards,
 > Thomas.



This archive was generated by hypermail 2b29 : Tue Jan 01 2002 - 17:51:08 MET