Re: [ROOT] Crashes running TRootEmbeddedCanvas in a Thread

From: Thomas Bretz (Thomas_Bretz@ph.tum.de)
Date: Mon Oct 06 2003 - 11:30:46 MEST


Sorry, that was copy&paste...

before app.Run(kTRUE);

there must be:

TThread t(thread2);
t.Run();

Thomas...


On Mon, 6 Oct 2003, Ilka Antcheva wrote:

> Hi Thomas,
>
> How do you call thread2()?
>
> Cheers, Ilka
>
> Thomas Bretz wrote:
>
> > Dear all,
> >
> > can somebody tell me, why the following piece of code (compiled) crashes?
> > I'm using root 3.05/05. It does not crash if I create the Main Frame in
> > the main-function (which is not possible in my application)
> >
> > Thomas.
> > -----------------------------------------------------------------------
> > #include <TGFrame.h>
> > #include <TRootEmbeddedCanvas.h>
> > void *thread2(void*)
> > {
> >     TGMainFrame *f=new TGMainFrame(gClient->GetRoot(), 100, 200);
> >     TRootEmbeddedCanvas *c=new TRootEmbeddedCanvas("test", f,
> > f->GetWidth() , f->GetHeight() ,0);
> >
> >     f->AddFrame(c, new TGLayoutHints(kLHintsExpandX|kLHintsExpandY));
> >
> >     f->Layout();
> >     f->MapSubwindows();
> >     f->MapWindow();
> >     return 0;
> > }
> >
> > int main(int argc, char **argv)
> > {
> >     TROOT simple("m", "m");
> >     TApplication app("App", &argc, argv);
> >
> >     app.Run(kTRUE);
> >
> >     return 0;
> > }
>
>

-----
Würden Sie Windows 95 die Kontrolle eines AKWs überlassen?
Hiroshima '45...! Tschernobyl '86...!! Windows 95...!!!
Unix ist benutzerfreundlich - es ist nur etwas wählerisch..." (Walter Misar)
Was sagt ein arbeitsloser Physiker zu einem Physiker mit Arbeit?
 - "Eine Currywurst mit Pommes bitte!"



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