Re: [ROOT] GUI classes with TThread

From: Fons Rademakers (
Date: Tue Jan 20 2004 - 21:10:54 MET

Hi Kerry,

  to keep the GUI active while you are doing other things (like filling
histograms) call regularly: gSystem->ProcessEvents(). This call will
process all pending GUI events. For examples look into the
$ROOTSYS/tutorials directory and search for ProcessEvents. This kind of
processing is synchronous, does not use threads but should give the same

Cheers, Fons.

On Tue, 2004-01-20 at 16:39, LEE, KERRY T. (JSC-SR) (UHCL) wrote:
> ROOT team,
> I sent this message last week and since I have been spoiled in the past
> with quick replys I think it is possible that it has been overlooked. 
> I use RH 9.0 gcc 3.2.2, and tried my program with ROOT versions 3.10.02
> and 4.00.00 with the same results.
> Thanks
> Kerry
> -----Original Message-----
> From:
> To: ''
> Sent: 1/16/2004 4:46 PM
> Subject: [ROOT] GUI classes with TThread
> Dear ROOTers,
> I am attempting to create an online histogram monitoring GUI, in which
> many
> histograms are filled , but only displaying a few at a time.  I
> currently
> have a TListBox containing a list that selects which histograms are to
> be
> displayed, and a TROOTEnbededCanvas to display the histograms in.  This
> worked perfectly as long as the histograms were finished being filled
> (after
> my simulated online run).  While the run was in progress I could not
> interact with the GUI and change the histogram display.  My next step
> was to
> introduce TThreads via the TThreadframe example.  Unfortunately I did
> this
> before coming across the previous message
> ml
> which states that "Access to TCanvas, TPad and other graphics from
> threads.
> Does not work, even if access is locked explicitly.
> It seems that the errors occur in the X event handling
> outside root. Moving the mouse accelerates the crashes considerably."
> Prior
> to reading this I concluded (from stack dump) that there was probably
> something wrong with X event handling.  My program ran fine as long as I
> didn't select a different set of histograms to be displayed, and
> occasionally I could display different histogram sets but a crash was
> inevitable if I did that.  Further in the above mail it was stated that
> this
> problem was not likely to ever be fixed.
> Therefore, if anyone has similar monitoring requirements I'd like to
> hear
> how you overcame these problems.  Any help is appreciated.
> Thanks
> Kerry
Org:    CERN, European Laboratory for Particle Physics.
Mail:   1211 Geneve 23, Switzerland
E-Mail:              Phone: +41 22 7679248
WWW:      Fax:   +41 22 7679480

This archive was generated by hypermail 2b29 : Sun Jan 02 2005 - 05:50:05 MET