[ROOT] Having difficulties with connect() of a signal to a member of the same class

From: Ralph Steinhagen (Ralph.Steinhagen@post.rwth-aachen.de)
Date: Thu Feb 20 2003 - 09:29:31 MET


Hello,

I am trying to get familiarized to the gui functions of the ROOT package. Up 
to now I have done most of the gui design with Qt and are used to the signal 
slot mechanism.
I do not want to mix QT and ROOT code,  therefore I hope to being able to use 
ROOT for the analysing as well as for the gui.

I have a problem to connect a signal emited by a button to a function which is 
declared as a member in the same class.

class Monitor : public TGMainFrame {

private:
   // [..] some vars
public:

   Monitor(const TGWindow *win, const TGWindow *main, UInt_t w, UInt_t h);
   virtual ~Monitor();
 // [..]
   void DoDraw();
};

the connect call in the constructor:
[..]
button->Connect("Clicked()","Monitor",this,"DoDraw()");
[..]

The code compiles fine but complains during execution about:
"Error in <TQObject::CheckConnectArgs>: slot DoDraw() does not exist"

I have checked the following thread:
http://root.cern.ch/root/roottalk/roottalk02/0735.html
"[ROOT] cant connect slot to THIS pointer ?"
and created a dictionary with
rootcint "mysourceDict" -c "mysource"
and followed the steps explained in:
http://root.cern.ch/root/CintGenerator.html
but it still does not function as it is mentioned. 
In fact my DoDraw() function is not even mentioned in the generated files.

I would be glad if sombody might enlighten me because I think the signal slot 
mechanism might save lots of my time. 

Best regards,

Ralph



This archive was generated by hypermail 2b29 : Thu Jan 01 2004 - 17:50:09 MET