RE: PyRoot troubles ( was Qt thread seems blocked in ipython after gROOT.ProcessLine)

From: Fine, Valeri <fine_at_bnl.gov>
Date: Thu, 21 Apr 2011 18:48:46 -0400


As soon as Qt is concern I do not find your example is Qt / Thread related.

On the hand, I know that the PyRoot creates an extra thread behind the scene (nothing to do with Qt) to monitor the ROOT event loop. Hope the PyRoot guys will explain you better what is going on. I am afraid your subj confused them. I have renamed the Subj and Cc-ed: to wlavrijsen_at_lbl.gov (PyRoot guru) to call his attention.

Best regards , Valeri Fine



Brookhaven National Laboratory
Upton, NY 11973
Phone +1-631-344-7806

> -----Original Message-----
> From: owner-roottalk_at_root.cern.ch [mailto:owner-roottalk_at_root.cern.ch]
On Behalf Of
> Benjamin Bannier
> Sent: Thursday, April 21, 2011 4:01 PM
> To: ROOT Talk
> Cc: ROOT Talk
> Subject: Re: [ROOT] Qt thread seems blocked in ipython after
gROOT.ProcessLine
>
> Hi Valeri,
>
> > Where is your Qt thread come from?
>
> That was my (probably wrong) guess that there was a thread running
watching for necessary
> GUI updates.
>
> > Anyway, if you want the Qt thread working you should use PyRoot with
> > QtRoot plugin. The latter is to provide you the Qt eventloop you
(your
> > application;-) likely need to manage the QThread messages properly.
>
> I do not have QtRoot available and don't have enough control over my
installation.
>
> > It is hard to be more concrete. One needs to see your code. Sorry, I
> > did not understand why you spoke about the QThread yet.
>
> I reduced the problematic code to the snippet I provided. Here it is
> again:
>
> > > #!/bin/env ipython
> > > import ROOT as r
> > >
> > > # uncommenting this blocks TCanvas updates
> > > #r.gROOT.ProcessLine('.x ~/.root_logon.C')
> > >
> > > When I execute this file and interactively enter
> > >
> > > h = r.TH1D('h', '', 100, -10, 10)
> > > h.Draw()
> > > h.FillRandom('gaus', 1000)
> > > h.Draw()
> > >
> > > ...
>
> Prompted by your suggestion to "create my application the ROOT way" I
just for fun replaced
>
> r.gROOT.ProcessLine('.x ~/.root_logon.C')
>
> with
>
> app = r.TRint('app')
>
> and ended up with the same problem of the canvas not updating
automatically after
> modification anymore.
>
> To make sure I'd screw up as little as possible I emptied my
.root_logon.C file so that it now
> looks like
>
> {
> }
>
> My guess is that there is some automatic magic going on behind the
scenes when I call
> gROOT.ProcessLine (like initialization of static
> objects) which messes up the canvas updates in my case. My question
was how to work
> around this.
>
>
> Thank you for your help,
>
> Benjamin
Received on Fri Apr 22 2011 - 00:48:55 CEST

This archive was generated by hypermail 2.2.0 : Fri Apr 22 2011 - 05:50:02 CEST