# X Close Button Of A Window

**URL:** https://forum.highend3d.com/t/x-close-button-of-a-window/2803
**Category:** Maya
**Tags:** mel
**Created:** [September 22, 2006, 8:32am UTC](https://forum.highend3d.com/t/x-close-button-of-a-window/2803 "2006-09-22T08:32:53Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![diskhub](https://forum.highend3d.com/user_avatar/forum.highend3d.com/diskhub/32/54686_2.png) [@diskhub](https://forum.highend3d.com/u/diskhub)
#### Post date: [September 22, 2006, 8:32am UTC](https://forum.highend3d.com/t/x-close-button-of-a-window/2803/1 "2006-09-22T08:32:53Z")

</div>

I have create a window UI, however is there a way to track if the user were to click on the X CLOSE button on the top right of the Window?

I want to do something like if the user were to click on the X button,   
another window's visibiliy turns 1. (window -visibility 1)

Can someone please guide?

---

<div class="post-metadata">

### Author: ![amitc](https://forum.highend3d.com/letter_avatar_proxy/v4/letter/a/da6949/32.png) [@amitc](https://forum.highend3d.com/u/amitc)
#### Post date: [September 22, 2006, 8:46am UTC](https://forum.highend3d.com/t/x-close-button-of-a-window/2803/2 "2006-09-22T08:46:01Z")

</div>

1) Hide the title bar and create an exit/quit button. Do the stuff you want when this button is pressed and close window.

2)Create a scriptjob which does your stuff on uiDeleted event

---

<div class="post-metadata">

### Author: ![kurianos3d](https://forum.highend3d.com/user_avatar/forum.highend3d.com/kurianos3d/32/55947_2.png) [@kurianos3d](https://forum.highend3d.com/u/kurianos3d)
#### Post date: [September 22, 2006, 12:28pm UTC](https://forum.highend3d.com/t/x-close-button-of-a-window/2803/3 "2006-09-22T12:28:24Z")

</div>

i think you can use

toggleWindowVisibility  
check the commands for this

CODE  
[http://localhost:4449/Maya7.0/en\_US/Commands/toggleWindowVisibility.html](http://localhost:4449/Maya7.0/en%5C_US/Commands/toggleWindowVisibility.html)
