Thanks for looking at my question.
I have a Python toolbar with a button that runs a Python script that displays a menu box. This is being ran through ArcMap. I open my mxd, display the menu, now I want to close it when I am finished and that is the problem.
I am calling:
def quit():
root.destroy()
to close the menu from a button command.
When I run the script in pyscripter and display the menu box and hit the close button it works.
When I have the menu box open in ArcMap and hit the close button I get the following error:
Traceback (most recent call last):
File "C:\Python27\ArcGIS10.5\Lib\lib-tk\Tkinter.py", line 1542, in __call__
return self.func(*args)
File "D:\Applications\Python\Layers.py", line 49, in quit
root.destroy()
NameError: global name 'root' is not defined
The next issue I see is how to close the Python box when I close ArcMap.
Thanks for looking at my question.