All pastes #14152 Raw Edit

Something

public text v1 · immutable
#14152 ·published 2005-06-12 20:28 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()