[Tutor] Application Error
shendric@arches.uga.edu
shendric@arches.uga.edu
Wed, 27 Mar 2002 15:55:02 -0500
Hi all,
I apologize if you get this twice, my email went a little haywire, so
I'm resending.
I also apologize for the faux pas about Tkinter. I suppose what I meant
was that most of what I've seen on this list doesn't involve GUI
programming.
Anyway, as suggested, I'm posting the code for this. Any suggestions
would be appreciated:
"""
QTMod.py
Sean Hendricks, based on Kazuaki Maeda
Requires QuickTimeTcl (http://hem.fyristorg.com/matben/qt/)
It also calls for a movie file, which I didn't include, so you might
want to comment out the lines referring to the function loadmov, if you
decide to run the program.
"""
from Tkinter import *
try:
import Pmw
except ImportError:
print "No Pmw available"
Pmw = None
class QuickTime(Widget):
""" Class definition for QuickTimeTcl widget """
def __init__(self, master=None):
master.tk.eval('package require QuickTimeTcl')
Widget.__init__(self, master, 'movie')
def play(self):
self.tk.call(self._w, 'play')
def stop(self):
self.tk.call(self._w, 'stop')
def gettime(self):
return self.tk.call(self._w, 'gettime')
def loadmov(self):
return self.tk.call(self._w, 'configure', '-file',
'HazenIrreg21PDTest.mov')
# end of class definition for QuickTime
if __name__ == "__main__":
root = Tk()
root.tk.eval('package require QuickTimeTcl')
a = QuickTime(root)
a.pack()
a.loadmov()
root.mainloop()
Thanks,
Sean
>>
>>I know most of you are working with Python, not Tkinter, but since
>>Tkinter came up recently, I thought someone might have an idea.
>
>Note: Tkinter is part of Python -- is the Python module
>used to wrap Tk functionality. So saying "Python, not
>Tkinter" is a bit confusing.
>
>You'll probably need to post your code if you want serious
>help debugging.
>
>Kirby
>
>
---------End of Included Message----------