# Customized Message Box - Vision

**URL:** <https://forum.inductiveautomation.com/t/customized-message-box-vision/64578>\
**Category:** Ignition\
**Tags:** vision\
**Created:** [September 28, 2022, 7:43am UTC](https://forum.inductiveautomation.com/t/customized-message-box-vision/64578 "2022-09-28T07:43:27Z")\
**Posts on this page:** 1\
**Page:** 2

<div class="post-metadata">

**Author:** ![justinedwards.jle](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/justinedwards.jle/32/37854_2.png) [@justinedwards.jle](https://forum.inductiveautomation.com/u/justinedwards.jle)\
**Post date:** [September 30, 2022, 6:23am UTC](https://forum.inductiveautomation.com/t/customized-message-box-vision/64578/21 "2022-09-30T06:23:23Z")

</div>

Yes. Say you have a project library named projectScripts, and in projectScripts, you have your disposeDialog definition:  
 ![image](https://us1.discourse-cdn.com/inductiveautomation/original/3X/e/f/ef8e2c4365bc8f09217aa03ea0407e2c4ac75fb4.png)

For this script to work, the definition is going to need to pass in the variable (self), so the prefix for the definition would have to be changed from `def disposeDialog():` to `def disposeDialog(self):`

Then, when you call the function, you will need to pass your source into the definition. For example, if I were to call the definition from the actionPerformed script on a button, the code would look like this: `projectScripts.disposeDialog(event.source)`

Putting it all together for this usage case, the first 5 rungs of the definition in the project library should look this:

```auto
def disposeDialog(self):
	def closeWindow():
		from javax.swing import SwingUtilities
		parent = SwingUtilities.getRoot(self)
		getWindows = parent.getWindows()

```

[Previous page](https://forum.inductiveautomation.com/t/customized-message-box-vision/64578.md?page=1)
