Forum Moderators: Staff
Poser Python Scripting F.A.Q (Last Updated: 2024 Sep 18 2:50 am)
Mason- post your script if the stuff below doesn't work. I think I know what your problem is as I ran into something similar. Want to start you script something like this: root=Tk() # rest of script. Use root as master for gui items root.mainloop() If you don't do the root=Tk() and then use root as the master to feed into all your gui items, when you exit the script you basically kill off the Tkinter instance that's running and he next Tkinter call in the next script you run will generate error messages. For example, if you just did a "Label(text="test") you'll kill the Tkinter instance that's running. Instead you want to do a Label(root, text="test"). This way root is feed in to the Label as the master so that when the Label is destroyed the script local instance of Tkinter, generated by the root=Tk(), is destroyed instead of the main instance. If you kill the Tkinter instance you then have to do a Reinitialize Python off the main Poser menu. Hope this helps. P.S. Try: http://www.pythonware.com/library/tkinter/ for the intro to Tkinter and http://www.python.org/doc/life-preserver/ for the Tkinter life preserver
I'd also suggest setting up as much as your script as possible outside of Poser. This is especially true for the TkInter stuff since Poser seems to not handle these types of problems very well. I've been using PythonWin to setup and test the GUI parts of the scripts with just 'pass' stubs in the callback handlers. After all that works, I go back in and add the Poser related code. It has saved me lots of headaches.
This site uses cookies to deliver the best experience. Our own cookies make user accounts and other features possible. Third-party cookies are used to display relevant ads and to analyze how Renderosity is used. By using our site, you acknowledge that you have read and understood our Terms of Service, including our Cookie Policy and our Privacy Policy.
Attached Link: http://www.nmt.edu/tcc/help/pubs/lang.html
I stumbled over this trying to solve a Tkintr puzzlement. The Tkintr reference fills in some gaps in the other documentation for it that I've seen, which more than makes up for the awful, awful font (for trying to read) they've chosen.