Re: TGTextView window close signal connect

From: Bertrand Bellenot <bertrand.bellenot_at_cern.ch>
Date: Wed, 28 Jul 2010 19:12:07 +0200


Hi Nicolas,

You have to be careful when using signals slots with objects being destroyed, since the actual X window may already be gone and the slot still trying to access it...
Anyway, it is hard to tell exactly what's going on with so little information. Could you provide a short running macro reproducing the problem?

Cheers, Bertrand.

On 7/28/2010 5:59 PM, Nicolas Produit wrote:
> Hi,
>
> is it possible to Connect to a window close event of an object of type
> TGTextView?
>
> I tried:
>
> cond=new TGTextView(gClient->GetRoot());
> cond->MapSubwindows();
> cond->MapWindow();
> cond->MoveResize(900,600,300,300);
> cond->GetCanvas()->Connect("Destroyed()","MonitorFrame",this,"CloseWindow()");
>
> this does not give error messages so it seems the Destroyed() signal
> from the TQObject can be connected but then when killing the window I
> get a:
> Error in<RootX11IOErrorHandler>: fatal X11 error (connection to server
> lost?!)
> rather to a call to my subroutine (the subroutine work for connected
> TCanvas on signal Closed())
>
> Thanks
>
>
Received on Wed Jul 28 2010 - 19:12:13 CEST

This archive was generated by hypermail 2.2.0 : Thu Jul 29 2010 - 11:50:01 CEST