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: -
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'])
-
and this is what i get: - 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'
That's because method call pack() returns None. Assign the widget instance to chatsend without calling pack(), then call chatsend.pack() on the next line.
2 9403 bvdet 2,851
Expert Mod 2GB
That's because method call pack() returns None. Assign the widget instance to chatsend without calling pack(), then call chatsend.pack() on the next line.
Thanks so much, i really apreciate your help and time spent
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Casey Hawthorne |
last post by:
Is there a better way to delete the image from a Tkinter button other
than the following:
- reconstructing the button
- image=blank.gif
--
Regards,
|
by: [Yosi] |
last post by:
I search solution for a little bit strange problem , I working on an
application which includes a button.
Click on this button will create number of threads each one execute deferent
executable...
|
by: Steve |
last post by:
Hi,
Is it possible to make hitting the enter key in an ASP
textbox run the code behind an ASP button on a form?
I have a search page which users tend to type in the
query then just hit enter...
|
by: radders |
last post by:
Hi guys,
What I'd like to do is place three edit boxes with three static text labels on a click button. This would let the user input RGB values to the three edit boxes and then click the...
|
by: eddie69 |
last post by:
Hi,
Newbie question here:
I am creating an application in VB Studio 2005 which reads the status of an USB PIR Motion sensor.
So far, I have managed to get the application to read the motion...
|
by: Thammarat charoenchai. |
last post by:
Hi, I'm try to learn vb.net.
in delphi have .click method for click button by coding.
Can I do that with vb.net
Thank you very much.
|
by: laziers |
last post by:
Hi,
anyone know how to write a single-cilick button?
I use this:
<asp:button id="ButtonAdd" runat="server" text="Anuluj"
onclick="Click_ButtonAdd" />
if ( !isPostBack){...
|
by: Philip Fortuna |
last post by:
Hi,
I have a database in which me and my collegues do some registries. I would like to block the finished entry with a button so anyone besides the ones that know how to edit the tables?
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: jinu1996 |
last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
|
by: Hystou |
last post by:
Overview:
Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome a new...
|
by: conductexam |
last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
| |