We're having a project to make a Backup and Restore program in Python. As we think that making a GUI is of course very important, we started using Tkinter after initially trying wxPython which was kind of difficult given the time we had.
Either way, we made a Class where the main window is. Inside this Class, there is another Class defined, which contains the code of the another Window, where one can chose the options of the backup proccess. So, here's the thing. While we have made two text entries and two buttons, when trying to load an image, or any label for all it matters, it just won't appear, and we get the following error in Python Shell.
Exception in Tkinter callback Traceback (most recent call last): File "C:\Python25\lib\lib-tk\Tkinter.py", line 1414, in __call__ return self.func(*args) File "C:\Users\Ash_Pokemaster\Desktop\project_e31\kuygku.py", line 110, in backup_window back = Backup(buwind) File "C:\Users\Ash_Pokemaster\Desktop\project_e31\kuygku.py", line 94, in __init__ self.labelcho = Button(framebu, image= photocho) File "C:\Python25\lib\lib-tk\Tkinter.py", line 2012, in __init__ Widget.__init__(self, master, 'button', cnf, kw) File "C:\Python25\lib\lib-tk\Tkinter.py", line 1942, in __init__ (widgetName, self._w) + extra + self._options(cnf)) TclError: image "pyimage8" doesn't exist
Here is the code along with the images.
We would appeciate it if you could try create an image inside the Backup Class, and figure out what the problem is.
So far, this is what we type between the two text entry eidgets, and of course doesn't work:
photocho = PhotoImage(file=choose.gif") self.labelcho = Button(framebu, image= photocho) self.labelcho.image = photocho self.labelcho.pack() self.labelcho.grid(row=2, column=0)
Image "choose.gif" is not inside the zip, but I guess any image would work...
Thanks for your time.