En Sun, 06 Apr 2008 15:12:55 -0300, <[EMAIL PROTECTED]> escribió:

I can't help with your sizing problem, I don't know grids. But don't do  
this:

>     def Display(self, number):
>         self.expr = self.expr + number
>         self.lbText = Label(self, text=self.expr)
>         self.lbText.grid(row=0, column=0)
>
>     def Calculate(self):
>         self.expr = str(eval(self.expr))#try catch tex 3+6+
>         self.lbText = Label(self, text=self.expr)
>         self.lbText.grid(row=1, column=1)
>         self.expr = ""

You're creating a *new* Label object for each keystroke (they stack on the  
same place and only the newest is visible, I presume).
Instead, you should change the text inside the existing widget:

     self.lbText.config(text=self.expr)

(there is no need to reposition the widget)
Label is described here http://effbot.org/tkinterbook/label.htm
and you may want to learn to use Tkinter variables:  
http://effbot.org/tkinterbook/variable.htm

-- 
Gabriel Genellina

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to