[Tutor] Tkinter and canvas question
Phil
phil_lor at bigpond.com
Tue Apr 18 01:55:19 EDT 2017
On Mon, 17 Apr 2017 22:57:41 -0500
boB Stepp <robertvstepp at gmail.com> wrote:
> I have yet to do much class writing with tkinter, but if I am
> understanding things correctly, in your Sudoku class where you
> instantiate a Canvas instance, you assign it to the name "the_canvas".
> This will be local to the __init__ method's namespace. I think you
> need to precede each of those "the_canvas" with "self." to get
> "self.the_canvas". This way your solve method will be able to access
> it.
Thank you Bob. I was fixated on the error being elsewhere and didn't think about the_canvas being just another attribute of the class. It seem obvious now that I've been shown.
--
Regards,
Phil
More information about the Tutor
mailing list