Message 1 of 4
Deleting an existing window
Not applicable
07-07-2009
09:31 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello,
I have a UI Window that is created by clicking on a Maya menu item at the top of maya. I have code that is suppose to delete the window if it exists but for some reason it always returns false and another window is created.
def showMyWindow(*args):
# We only want one window at a time
if mel.eval('window -exists myWindow'):
mel.eval('deleteUI myWindow')
# Make the window
myWindow = window( title="Actor Information", iconName='ActorInfo',widthHeight=(260,350))
myWindow.show()
I'm wondering if the problem might be that I am creating the window in pymel but checking for it's existence through Mel?
I have a UI Window that is created by clicking on a Maya menu item at the top of maya. I have code that is suppose to delete the window if it exists but for some reason it always returns false and another window is created.
def showMyWindow(*args):
# We only want one window at a time
if mel.eval('window -exists myWindow'):
mel.eval('deleteUI myWindow')
# Make the window
myWindow = window( title="Actor Information", iconName='ActorInfo',widthHeight=(260,350))
myWindow.show()
I'm wondering if the problem might be that I am creating the window in pymel but checking for it's existence through Mel?