I am still pretty interested to know how do one go on from there?​

Now that we know it’s a PyQt object, we can do something like this.

import animTools
animApp = animTools.launchAnimTools()
def myCloseEvent(event):
    print "Closing!"

widget.closeEvent = myCloseEvent

Or, since you know know the superclass, you can subclass it.

class MyAnimTools(animTools.createAnimationToolsUI):
    def closeEvent(self, event):
        print "Closing!"
        super(MyAnimTools, self).closeEvent(event)

Thus having your own “wrapper” around the original, that you can call
instead.

myAnimApp = MyAnimTools()
myAnimApp.show()

However, as the animTools.createAnimationToolsUI object is returned by
animTools.launchAnimTools() I can’t be sure if it’s doing anything else to
the object before returning it.

To find that out, you can either open that file, or print the source code
for the function and have a look.

*Get file path to function*

>>> import animTools>>> print animTools
<module 'animTools' from '/somewhere/on/your/server/animTools.py'>

*Or print the source code directly*

>>> import animTools>>> import inspect>>> print 
>>> inspect.get_source(animTools.launchAnimTools)

​

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOBYgti8%2BswfnpbQD99OfNqeARPuk9BBAT-FbaKdGZT5%3Dg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to