All pastes #12283 Raw Edit

Something

public text v1 · immutable
#12283 ·published 2005-05-20 19:05 UTC
rendered paste body
import sys
from Tkinter import *
class makemasta:
    def printit(self):
        if self.source.get() == "":
            self.mylabel.set("Nothing wroten in the Text Field!" + "\n" + self.mylabel.get())
        else:
            self.mylabel.set(self.source.get() + "\n" + self.mylabel.get())
        self.source.set('')
    def __init__(self):
        self.ss = Tk()
        self.ss.title("hello")
        self.mylabel = StringVar()
        Label(self.ss,text="hello",textvariable=self.mylabel).pack()
        self.source = StringVar()
        Entry(self.ss,textvariable=self.source).pack()
        Button(self.ss,text="Press me!",command=self.printit).pack()
        self.ss.mainloop()
makemasta()