def main():
global win
try:
win.close()
except: pass
win = MyWindowClass()
win.show()
Thank You.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/da0be90d-88fd-4e22-a25e-67c9e024d3d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/-O5JDzj0X1s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA31y5iQ9MC6JVKVMKoaMKh%3DmNtZwHm6GOKVDo_zWWMxJg%40mail.gmail.com.
Hello Justin,Thanks for the replyand sorry for late reply i was not wellIf your UI is still showing when they click the button a second time do you want it to close the existing one and show a new one?yesOr do you want it to leave the exist one and show a new copy?noI'm guessing from your example that you keep a global reference to the UI instance that you launch, in your module, and that you probably launch it by calling a main() function. If that is what you do, you can try calling win.deleteLater() to kill the existing one and catch the exception if it's not there.the way i am doing isi have created multiple classes and saved as a packageand i have the path saved in env variableso i just import the module and do exactly as you mentioned above execute main()so i saved the above import in the shelfclicking it opens the UIclicking the shelf button second time should close the existing UI and open the UI again and, even if the UI is closed its instance should be deleted and, when clicked on shelf button again create a new UI(instance)probably this is what you meantWhat is the logic behid this?if you want to allow multiple brand new instances, you can just not use the global to that you create a new one each time, and then have it automatically delete itself on closewin = CreateNewWin(...)win.setAttribute(QtCore.Qt.WA_DeleteOnClose, True)and which is the most preferred one
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAJsZk%2BWPceNG%3D2UAQunWh0XN7EBXmgs9CDiBhhUVb80b%3D%2BjUFA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0VTf7rVU%2Beo8-evMecStw%3Dj9Qtd3en0QVg5_xOyg7f4w%40mail.gmail.com.
yesbut again is this the preferred technique
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAJsZk%2BVdsuKK5dur-Fnwg1xSDHM8c4cGQyoC2Y39mzwJiYUS5w%40mail.gmail.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/da0be90d-88fd-4e22-a25e-67c9e024d3d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/-O5JDzj0X1s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA31y5iQ9MC6JVKVMKoaMKh%3DmNtZwHm6GOKVDo_zWWMxJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_maya+unsub...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAJsZk%2BWPceNG%3D2UAQunWh0XN7EBXmgs9CDiBhhUVb80b%3D%2BjUFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/-O5JDzj0X1s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_maya+unsub...@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/da0be90d-88fd-4e22-a25e-67c9e024d3d9%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/-O5JDzj0X1s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA31y5iQ9MC6JVKVMKoaMKh%3DmNtZwHm6GOKVDo_zWWMxJg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAJsZk%2BWPceNG%3D2UAQunWh0XN7EBXmgs9CDiBhhUVb80b%3D%2BjUFA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/-O5JDzj0X1s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA0VTf7rVU%2Beo8-evMecStw%3Dj9Qtd3en0QVg5_xOyg7f4w%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
--
You received this message because you are subscribed to a topic in the Google Groups "Python Programming for Autodesk Maya" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/python_inside_maya/-O5JDzj0X1s/unsubscribe.
To unsubscribe from this group and all its topics, send an email to python_inside_m...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/5fdc601d-a4c5-47fa-85b2-4113652da455%40googlegroups.com.
Hi Justin, its a question about the technique that i have used is it appropriate for longer term?
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAJsZk%2BVreUJk%3D_TPN5GJ1SZERHH8QL_ut_Mt%2Bbg5x_HMXmWKNA%40mail.gmail.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/python_inside_maya/CAPGFgA10%3DG72Vcake6-2UU%3DXasgaKc%3DmZu51494thwiSZtpURg%40mail.gmail.com.