I'm looking for a simle form to delete the entry content after pushing a button, in the next link the solution for the code works (verified it), after read that i try it, but it doesn't work for me
http://bytes.com/topic/python/answers/867449-gui-text-entry-tkinter
Python 2.7.9 [MSC v.1500 64 bit (AMD64)] on Windows 7 64 bits
this is the part of code that i can't fix:
and this is what i get:
http://bytes.com/topic/python/answers/867449-gui-text-entry-tkinter
Python 2.7.9 [MSC v.1500 64 bit (AMD64)] on Windows 7 64 bits
this is the part of code that i can't fix:
Code:
import Tkinter
def evclr():
chatsend.delete(0,END)
def chat(user, items, userslist):
global chatsend
v0 = Tkinter.Tk()
v0.geometry('450x250+100+100')
v0.title('J+ CHATTING ROOM Welcome')
chat_msg = Tkinter.StringVar()
chatwindow = Tkinter.Text(v0, height=12, width=55)
chatwindow.insert(Tkinter.INSERT, chat_content)
chatwindow.pack()
chatsend = Tkinter.Entry(v0, bd=3, textvariable=chat_msg).pack()
sendbutton = Tkinter.Button(v0, text='SEND', command=evclr).pack()
v0.mainloop()
chat_content = '''
Tue 07 Apr 2015
12:11:25
X> ===í}
éé===
'''
chat('X', [0, 2], ['CARLOS VILLALOBOS', 'CESAR BENCOMO', 'JOHNNY CASH'])
Code:
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\64\lib\lib-tk\Tkinter.py", line 1532, in __call__
return self.func(*args)
File "C:/Python27/Scripts/prueba04.py", line 13, in evclr
chatsend.delete(0,END)
AttributeError: 'NoneType' object has no attribute 'delete'
Exception in Tkinter callback
Traceback (most recent call last):
File "C:\Python27\64\lib\lib-tk\Tkinter.py", line 1532, in __call__
return self.func(*args)
File "C:/Python27/Scripts/prueba04.py", line 13, in evclr
chatsend.delete(0,END)
AttributeError: 'NoneType' object has no attribute 'delete'
Comment