problem with tkinter

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • max(01)*

    #1

    problem with tkinter

    hello.

    the following code:

    1 from Tkinter import *
    2
    3 class MiaApp:
    4 def __init__(self, genitore):
    5 self.mioGenitor e = genitore
    6 self.i = IntVar()
    7 self.i.set(42)
    8 self.s = StringVar()
    9 self.s.set("Bao bab")
    10 self.lab = {}
    11 self.lab["self.i"] = Label(self.mioG enitore)
    12 self.lab["self.i"].configure(widt h = 30, relief = RIDGE,
    13 text = "[vuota]")
    14 self.lab["self.i"].pack()
    15 self.lab["self.s"] = Label(self.mioG enitore)
    16 self.lab["self.s"].configure(widt h = 30, relief = RIDGE,
    17 text = "[vuota]")
    18 self.lab["self.s"].pack()
    19 self.but = Button(self.mio Genitore)
    20 self.but.config ure(text = "Vai!", command = self.procedi)
    21 self.but.pack()
    22 def procedi(self):
    23 for var in ("self.i", "self.s"):
    24 self.lab[var].configure(text variable = var)
    25
    26 radice = Tk()
    27 miaApp = MiaApp(radice)
    28 radice.mainloop ()

    is intended
Working...