I am trying to build a standalone program which uses the ROOT GUI classes, but for some reason, I can’t get the TGTextButton to connect its Clicked signal to a specified method. Weirdly though, I get no compilation errors, no runtime error messages about connection error, and a TGComboBox in the same program connects fine via its Selected(Int_t) signal. The actual code is pretty lengthy but the relevant bits are:
gtimaker.h
[code]class gtimaker{
RQ_OBJECT(“gtimaker”)
public :
…
void DoGetData();
void Unlock();
…
private :
…
TGComboBox * runList;
TGTextButton *getDataButton;
…
void GetData();
…
ClassDef(gtimaker, 1)
};[/code]
gtimaker_LinkDef.h
[code]#ifdef CINT
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class gtimaker+;
#endif[/code]
gtimaker.cpp
ClassImp(gtimaker)
...
TGComboBox * runList = new TGComboBox(buttonFrame, "Select Run");
TGTextButton * getDataButton = new TGTextButton(buttonFrame, "Get &Data");
...
// This button needs to be disabled until a selection is made from runList
getDataButton->SetState(kButtonDisabled);
...
getDataButton->Connect("Clicked()","gtimaker",this,"DoGetData()");
TQObject::Connect(runList,"Selected(Int_t)","gtimaker",this,"Unlock()");
...
void gtimaker::Unlock(){
std::cout << "Unlock Called!" << std::endl;
if(histsSet){
writeButton->SetState(kButtonUp);
addBadButton->SetState(kButtonUp);
updateBadButton->SetState(kButtonUp);
unlocked=true;
}
getDataButton->SetState(kButtonUp);
}
...
void gtimaker::DoGetData(){
std::cout << "DoGetData Called!" << std::endl;
GetData();
}
As I say, the TGComboBox works fine (“Unlock Called!” is printed and the button is indeed unlocked), so I’m guessing all the compilation has been done correctly.
Does anyone have any ideas?
Cheers,
Hugh
[/code]