When I create my class, I create a variable called
self.canvas_height= self.canvas.winfo_height()
in which I store the result number of a method I invoke. So much the better but after that same class I create a function dibujar
where at some point I try to call variable self.canvas_height
and it does not work ...
BUT I was testing with the second variable width
and instead of invoking the data using the variable, I said Ok let's try calling the function directly, in this case it worked.
My question is, why does not it work in the Height case when I call the variable?
from Tkinter import *
import time
import random
class pelota:
def __init__(self,canvas,color):
self.canvas_height= self.canvas.winfo_height()
self.canvas_width = self.canvas.winfo_width()
def dibujar(self):
if pos[2]>=self.canvas.winfo_width():
if pos[3]>=self.canvas_height: