Confusing: Canvas image working in function but not in class

Mudcat mnations at gmail.com
Fri Apr 22 21:51:54 EDT 2005


I will answer my own question in case anyone else ever has this
problem.

I knew the problem (although some say it's not) existed with the
namespace of pictures, that if you didn't save the pictures in
persistent memory they would disappear as soon as the function that
called them was exited. So a while ago I went through this and fixed it
by saving all my pictures and widgets that held them as class objects.

However, apparently I was causing the same thing to happen by not
saving the class instance as an object of the class that called it. So
this fixed it:

    def uts5100(self):
        self.sys5100 = UTS5100( self.master )




More information about the Python-list mailing list