Qt thread seems blocked in ipython after gROOT.ProcessLine

From: Benjamin Bannier <bbannier_at_gmail.com>
Date: Thu, 21 Apr 2011 14:41:22 -0400


Dear ROOT experts,

I am trying to use ipython as a convenient replacement for CINT, but somehow loading my root_logon.C file seems to block the Qt thread.

Simplified my shell.py looks like this

    #!/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()

I do see the filled TH1. With the last line in my wrapper script uncommented I however need to click the canvas or issue a c1->Update() to update it.

Putting above commands in a file script.py and running it interactively in ipython with

    %run -i script.py

does show the final, filled histogram in both cases.

How can I work around this issue to both load my root_logon.C file and keep TCanvases updating automatically?

Thanks,

Benjamin

Received on Thu Apr 21 2011 - 20:41:31 CEST

This archive was generated by hypermail 2.2.0 : Thu Apr 21 2011 - 23:50:02 CEST