QuickTimeTcl and Python/Tkinter crash

Mickel Grönroos mickel at csc.fi
Tue Mar 30 01:12:47 EST 2004


On Tue, 29 Mar 2004, Myles wrote:

> You might wish to try trapping the destroy event, and writing your own
> exit routine that explicitly destroys the Movie object.

I'm afraid writing an explicit destroy method did not do the trick. I
still get the same error. ("""The instruction at "0x6697c820" referenced
memory at "0x01681f1c". The memory could not be "written". Click on OK to
terminate the program""")

Here is the latest code (that still causes the crash):

-------------------------------

import Tkinter

class Movie(Tkinter.Widget):
    """Wrapper class for QuickTimeTcl::movie."""
    def __init__(self, parent, cnf={}, **kw):
	"""Constructor. Parameters the same as here:
        http://hem.fyristorg.com/matben/qt/htmldocs/movie.html"""
        parent.tk.eval('package require -exact QuickTimeTcl 3.1')
        Tkinter.Widget.__init__(self, parent, 'movie', cnf, kw)

def closing(m, r):
    """Test for destroying the movie and root window when clicking X."""
    m.destroy()
    m = None
    r.destroy()

root = Tkinter.Tk()
m = Movie(root, file="toaster.mpeg")
m.pack()
root.protocol("WM_DELETE_WINDOW",
              (lambda x=m, y=root: closing(x,y)))
root.mainloop()

## Tried the following too, but has not effect.
m = None
del m

----------------------------------

Any ideas what to try next!?

/Mickel G.

--
Mickel Grönroos, application specialist, linguistics, Research support, CSC
PL 405 (Tekniikantie 15 a D), 02101 Espoo, Finland, phone +358-9-4572237
CSC is the Finnish IT center for science, www.csc.fi




More information about the Python-list mailing list