473,473 Members | 1,513 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Tk.quit() now working!

i have a weired problem with button widget in Tkinter
the callback function(Tk.quit()) for button widget is not working! when
i 'press' the button
the GUI hangs.
code for displaying a 'button objec':
###################
import Tkinter
top=Tkinter.Tk()
button=Tkinter.Button(top,text='press me',command=top.quit)#callback to
end the appllication
button.pack()
Tkinter.mainloop()
###################
any comments?

Jan 29 '06 #1
3 2816
"al pacino" wrote:
i have a weired problem with button widget in Tkinter
the callback function(Tk.quit()) for button widget is not working! when
i 'press' the button
the GUI hangs.
code for displaying a 'button objec':
###################
import Tkinter
top=Tkinter.Tk()
button=Tkinter.Button(top,text='press me',command=top.quit)#callback to
end the appllication
button.pack()
Tkinter.mainloop()
###################
any comments?


how do you run your Tkinter program ?

</F>

Jan 29 '06 #2
>how do you run your Tkinter program ?

like? i was testing it in windows (interactive interpreter)

Jan 31 '06 #3
Fredrik Lundh wrote:
how do you run your Tkinter program ?

al pacino wrote: like? i was testing it in windows (interactive interpreter)


What Fredrik probably means is: Did you by any chance start it from
IDLE? In that case it will not work. It doesn't for me. The reason -
I've been told - is that IDLE itself is a tkinter application.

If you instead start it by simply double-clicking on its icon, as you
would start anything else in Windows, it should work as expected. It
does for me, on Win XP Pro.

HTH
/MiO
Jan 31 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Ezhil | last post by:
Hi- I am trying to create MS access file (.mdb) from the data set with the following code. Every thing is working fine. But I found the MSACCESS.EXE is still running in the Task Manager. When...
2
by: hsuntn | last post by:
I'm working with Office Application objects in a client/server WinForm application which allows the user to access remotely stored files. When the user opens the remote file, it is downloaded to...
6
by: Max | last post by:
I have the following code on a form that launches Microsoft Outlook and creates a new email message for the user: Outlook.Application oApp = new Outlook.Application(); Outlook.MailItem oMail...
2
by: GD | last post by:
Hi, There are serveral validation controls in our intranet application. The controls work fine on all of our local machines that have Windows XP professional operating systems on them. After...
5
by: mzdude | last post by:
I've just started playing with Python. Installed 2.5 on Windows XP system. I'm working through some of the examples in Programming Python 3ed by Mark Lutz. Given the following example when the Quit...
5
by: cameron | last post by:
I am working on an assignment where I have to allow end-users to enter in data and to have C++ make a calculation. From there I have to set up a loop to allow users to go back and enter new data or...
5
by: Mubs | last post by:
i have the following script.. but i cant get the quit command working... can some1 help quit = n host="$(hostname)" todaysdate="$(date)" lastboot="$(last reboot)" licensinginfo="$(uname...
3
by: sigkill9 | last post by:
I've been working on this script all weekend and am almost done with it accept for one last detail; implementing a "process another number?" prompt after a user input is processed. The script...
0
by: raddrummer | last post by:
Hi there, I have 2 issues happening that I could really use some help with. These are probably really easy.... 1) I'm using VB in Access to generate a Visio org chart and then save it to my...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
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,...
0
jinu1996
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...
1
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...
0
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...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.