Help with buttons and entry fields
sholden at holdenweb.com
Tue Sep 5 20:13:01 CEST 2000
Assuming you are still using Tkinter, the code below should elucidate.
The button's callback uses the special insert position END to append
something tpo the entry's current value.
> Heres a newbie question. I have a button and an entry field. Does anyone
> know how to get the entry field to display the number "1" whenever i press
> the button?
> Like if i press button 5 times there are 5 ones?
> Please help me.
from Tkinter import *
def __init__(self, window=None):
self.button = Button(window, text="Click Me", command=self.addaone)
self.entry = Entry(window)
if __name__ == "__main__":
root = Tk()
win = createStuff(root)
Helping people meet their information needs with training and technology.
703 967 0887 sholden at bellatlantic.net http://www.holdenweb.com/
More information about the Python-list