# Make closing a TCanvas window close the application

**URL:** <https://root-forum.cern.ch/t/make-closing-a-tcanvas-window-close-the-application/7020>\
**Category:** ROOT\
**Created:** [August 22, 2008, 9:16am UTC](https://root-forum.cern.ch/t/make-closing-a-tcanvas-window-close-the-application/7020 "2008-08-22T09:16:27Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![bellenot](https://root-forum.cern.ch/user_avatar/root-forum.cern.ch/bellenot/32/29217_2.png) [@bellenot](https://root-forum.cern.ch/u/bellenot)\
**Post date:** [August 22, 2008, 10:05am UTC](https://root-forum.cern.ch/t/make-closing-a-tcanvas-window-close-the-application/7020/2 "2008-08-22T10:05:23Z")

</div>

Hi

As you noticed, the Canvas::CloseWindow() signal doesn’t exist. Use Canvas::Closed() instead.  
Two examples:  
If the canvas has already been created and you have its pointer:

```auto
canv->Connect("TCanvas", "Closed()", "TApplication", gApplication, "Terminate()");

```

Otherwise, more generic way:

```auto
TQObject::Connect("TCanvas", "Closed()", "TApplication", gApplication, "Terminate()");

```

Cheers,  
Bertrand.

---

_[View the full topic](https://root-forum.cern.ch/t/make-closing-a-tcanvas-window-close-the-application/7020)._
