Hi.
I try to develop a simple graphic user interface to visualize and print some signal digital acquired. I try to develop using Kdeleop 3.1.1 under fedora core 3 using root 4.02/00.
my application is really simple, when a push one button on the Frame the member guiwindow::openfile() is executed.
this member calls another Object Member {VisEventsevent(index,20480); }that visualize a TGraph in the c1 Canvas.
When c1->Print(“p.ps”); is executed the program says a stack trace error…
where I wrong?
Thank’s
Matteo Sassi
guiwindows.h
#include <TQObject.h>
#include <RQ_OBJECT.h>
#include <TApplication.h>
#include <TBrowser.h>
#include <TGFrame.h>
#include <TGClient.h>
#include <TGButton.h>
#include <TGFileDialog.h>
#include <TGTextEditDialogs.h>
#include <TGraph.h>
#include <TStyle.h>
#include <TCanvas.h>
#include <TObject.h>
#include <TRootEmbeddedCanvas.h>
#include <TROOT.h>
/**
@author matteo sassi
*/
class guiwindow{
RQ_OBJECT(“guiwindow”)
protected:
TCanvas *c1;
TGMainFrame *fMain;
TRootEmbeddedCanvas *fCanvas;
int index;
char * filename;
public:
guiwindow(int x, int y);
~guiwindow();
void VisEventsevent(int index,int NoS);
void prova();
void prev();
void next();
void print();
void openfile();
};
#endif
member function
void guiwindow::openfile()
{
static const char NT[] = { “Sample Files”, ".smp",
“DatFiles”, “*.dat”,
0, 0 };
TGFileInfo *FI = new TGFileInfo();
FI->fFileTypes = NT;
FI->fIniDir = StrDup("/home/sax/lavoro/");
TGFileDialog *FD = new TGFileDialog(0, 0, kFDOpen,FI);
sprintf(filename,FI->fFilename);
index == 0;
gStyle->SetLineWidth(1);
VisEventsevent(index,20480);
c1->Print("p.ps");
}
Error
Generating stack trace…
0x0804df84 in guiwindow::openfile() + 0x10a from ./eventviewer
0x0804f72b in from ./eventviewer
0xf686ac67 in G__CallFunc::Exec(void*) + 0x71 from /usr/local/root/lib/root/libCint.so
0xf6aafbd6 in TQConnection::ExecuteMethod() + 0x6c from /usr/local/root/lib/root/libCore.so
0xf6ab2f3a in TQObject::Emit(char const*) + 0x300 from /usr/local/root/lib/root/libCore.so
0xf6244706 in TGButton::Clicked() + 0x26 from /usr/local/root/lib/root/libGui.so
0xf623f0d6 in TGButton::EmitSignals(bool) + 0x78 from /usr/local/root/lib/root/libGui.so
0xf623ee15 in TGButton::SetState(EButtonState, bool) + 0x8f from /usr/local/root/lib/root/libGui.so
0xf623efc7 in TGButton::HandleButton(Event_t*) + 0x131 from /usr/local/root/lib/root/libGui.so
0xf6271ac7 in TGFrame::HandleEvent(Event_t*) + 0x287 from /usr/local/root/lib/root/libGui.so
0xf6250744 in TGClient::HandleEvent(Event_t*) + 0xfe from /usr/local/root/lib/root/libGui.so
0xf6250376 in TGClient::ProcessOneEvent() + 0x74 from /usr/local/root/lib/root/libGui.so
0xf6250495 in TGClient::HandleInput() + 0x2d from /usr/local/root/lib/root/libGui.so
0xf624eb32 in TGInputHandler::Notify() + 0x1e from /usr/local/root/lib/root/libGui.so
0xf6baba55 in TUnixSystem::DispatchOneEvent(bool) + 0x65 from /usr/local/root/lib/root/libCore.so
0xf6acebce in TSystem::InnerLoop() + 0x18 from /usr/local/root/lib/root/libCore.so
0xf6aceb6e in TSystem::Run() + 0x7a from /usr/local/root/lib/root/libCore.so
0xf6a66e1e in TApplication::Run(bool) + 0x32 from /usr/local/root/lib/root/libCore.so
0x0804c3b6 in main + 0xa2 from ./eventviewer
0x00971e33 in __libc_start_main + 0xe3 from /lib/tls/libc.so.6
0x0804c181 in TApplicationImp::ShowMembers(TMemberInspector&, char*) + 0x31 from ./eventviewer