473,386 Members | 1,804 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Re: [Tkinter-discuss] (newbie) can't invoke button for twice

On Sat, Sep 20, 2008 at 4:10 PM, dmitrey <dm*******@ukr.netwrote:
>
hi all,
I have the problem:
a func has been binded to a Button:

RunPause = Button(root, textvariable = t, command = lambda:
invokeRunPause(p))

def invokeRunPause(p):
if p.state == 'init':
p.state = 'running'
t.set(' Pause ')
p.GUI_root.update_idletasks()
p.tmp_result = p.solve(*p._args, **p._kwargs)

elif p.state == 'running':
....
So the problem is that I can't invoke the button RunPause till my
calculations (in p.solve()) will be finished. I can observe it even
graphically, the button doesn't respond when it is pressed.
Could anyone provide a solution?
It is not only the button that doesn't respond, the entire application
won't respond if you are blocking tcl from processing anything. This
call to p.solve blocks, and, in turn the interpreter can't process
events and the GUI remains frozen till p.solve returns.
Ideally you should break this p.solve in steps, so you can schedule
next steps and the GUI will remain responsible, but if you can't break
it, and if it doesn't make sense to run it in another process then you
use a thread to solve this.
>
Thank you ion advance, Dmitrey.
--
View this message in context: http://www.nabble.com/%28newbie%29-c...p19588292.html
Sent from the Python - tkinter-discuss mailing list archive at Nabble.com.

_______________________________________________
Tkinter-discuss mailing list
Tk*************@python.org
http://mail.python.org/mailman/listinfo/tkinter-discuss


--
-- Guilherme H. Polo Goncalves
Sep 20 '08 #1
0 1229

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

Similar topics

0
by: Russell E. Owen | last post by:
I have a Python/Tkinter remote control application and want to add support for running user scripts. I would like the scripts to be written in python, would like them to be able to update...
4
by: Roland | last post by:
Salut, J'utilise LNUX RedHat 9.0 et je n'arrive pas ŕ utilser Tkinter car ŕ chaque fois que j'essaye de faire executer un code dans lequel j'ai importé le module Tkinter, j'obtient: from...
2
by: codecraig | last post by:
Hi, I was reading through the Tkinter tutorial at http://www.pythonware.com/library/tkinter/introduction/index.htm ...and it mentions that by doing, from Tkinter import * you have access to...
4
by: Peter G Carswell | last post by:
Good Morning. I am new to Tkinter. I have been testing the installation of Tkinter through the python web site. The first two test steps give no errors, 'import _tkinter' and 'import Tkinter'....
1
by: John Chambers | last post by:
Sp my latest adventure is attempting to use python's Tkinter module on a few machines. On my PB (OSX 10.3.9), I got the following confusing results: /Users/jc: python Python 2.3 (#1, Sep 13...
1
by: Kevin Walzer | last post by:
I'm not sure how often members of this list visit the Tkinter wiki at http://tkinter.unpythonic.net/wiki/FrontPage; this wiki seems to have less traffic in general than the Tcl/Tk wiki at...
44
by: bg_ie | last post by:
Hi, I'm in the process of writing some code and noticed a strange problem while doing so. I'm working with PythonWin 210 built for Python 2.5. I noticed the problem for the last py file...
1
by: vijayca | last post by:
my python installation is:Active python 2.5.1 i am using Red Hat Linux i have the Tkinter module installed but any simple script produces an error.... script: from Tkinter import Label widget...
8
by: karthikbalaguru | last post by:
Hi, One of my python program needs tkinter to be installed to run successfully. I am using Redhat 9.0 and hence tried installing by copying the tkinter-2.2.2-36.i386.rpm alone from the CD 3 to...
3
by: joshdw4 | last post by:
I hate to do this, but I've thoroughly exhausted google search. Yes, it's that pesky root window and I have tried withdraw to no avail. I'm assuming this is because of the methods I'm using. I...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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...

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.