from tkinter import *

class EntryDemo:
    def __init__(self, win):

        self.sv = StringVar()
        
        self.window = win

        e = Entry(win, textvariable=self.sv)
        e.config(state="readonly")
        e.pack()
        b = Button( text="Hi there!", command = self.clicked)
        b.pack()


    def clicked(self):
        print("Clicked!")
        self.sv.set("Boo!")
       




w = Tk()
app = EntryDemo(w)
w.mainloop()
