Newbie Tkinter problem 
Author Message
 Newbie Tkinter problem

Hi.

When I start the following script twice, without leaving python I got
TclError message (first time everything is OK). What am I doing wrong?

I am using Python 1.5.2 for Win32 with Mark Hammond's PyWin, but same
things happend on IDLE too.

Thanks in advance.
Simpa.

from Tkinter import *

class Wind:
    def __init__(self):
        self.root = Tk()
        self.root.title('Show image')

        self.c = Canvas(self.root,background = 'green')
        self.photo = PhotoImage(name = 'wedda',file="wedda.gif")
        self.c.create_image(0,0,image=self.photo,anchor=NW)
        self.c.pack(fill=BOTH,expand=1)

        self.root.mainloop()

MyWind = Wind()

Quote:
>>> Traceback (innermost last):

  File "D:\PythonW32\Pythonwin\pywin\framework\scriptutils.py", line
237, in RunScript
    exec codeObject in __main__.__dict__
  File "D:\Private\PythonProba\Tkinter\Image.py", line 17, in ?
    MyWind = Wind()
  File "D:\Private\PythonProba\Tkinter\Image.py", line 11, in __init__
    self.photo = PhotoImage(name = 'wedda',file="wedda.gif")
  File "D:\Python\Lib\lib-tk\Tkinter.py", line 1874, in __init__
    apply(Image.__init__, (self, 'photo', name, cnf, master), kw)
  File "D:\Python\Lib\lib-tk\Tkinter.py", line 1839, in __init__
    self.tk.call(('image', 'create', imgtype, name,) + options)
TclError: can't invoke "image" command:  application has been
destroyed


Mon, 15 Sep 2003 19:55:08 GMT  
 
 [ 1 post ] 

 Relevant Pages 

1. Newbie Tkinter Problem

2. newbie problems with Tkinter

3. Newbie problem with Tkinter

4. Newbie: Tkinter path type problems (W95)

5. Newbie Tkinter installation problem

6. newbie ?: Tkinter install problem on Linux

7. Newbie problems building Tkinter support under NT

8. NEWBIE QUESTION .... PROBLEMS WITH tkinter

9. Newbie: Problems with Tkinter

10. Newbie with Tkinter problems

11. Extensions/tkinter/* vs Modules/tkinter* (was: Python 1.1 w/ tkinter for AIX)

12. Newbie tkinter question: Scale release event?

 

 
Powered by phpBB® Forum Software