Python/Tkinter force wait on button click -


back after 30 minute search , either failure comprehend results or unable find results...

i want force application wait button click before continuing, , have following code snippet example:

...   def crack(self, filenamelist, forceclick):          forceclick += 1          self.crackbutton.configure(state='active')          if forceclick != 2:              self.crackbutton.bind('<buttonrelease-1>', self.crack(filenamelist, forceclick))          self.outputbox.insert(end, '\n' + 'parsing answer numerator...' + '\n')  ... 

i want load function crack(), increment 1 forceclick (which set 0 beforehand), change 'crack button' active state, , bind button while waiting user provoke bind. after bind provoked, function reloads, increments 1 forceclick, , skips if statement.

however, when run program through, binds key crack button , automatically reloads function bypass if statement... tried while loop before, did not end well...

any suggestions?

you need make bound function lambda:

self.crackbutton.bind('<buttonrelease-1>', lambda e: self.crack(filenamelist, forceclick)) 

currently calling function.

although there better ways trying accomplish, should fix immediate issue.


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -