Back after another 30 minute search and either failure to comprehend results or unable to find results…
I want to force my application to wait for a button click before continuing, and have the following code snippet as my 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 basically want it to load the function crack(), increment 1 to forceclick (which was set to 0 beforehand), change the ‘crack button’ to an active state, and then bind the button while waiting for the user to provoke the bind. After the bind is provoked, the function reloads, increments one to forceclick, and then skips the if statement.
However, when I run the program through, it just binds the key to the crack button and automatically reloads the function to bypass the if statement… I tried a while loop before, but that did not end well…
Any suggestions?
You need to make the bound function a lambda:
Currently it is calling the function.
Although there are probably better ways to do what you are trying to accomplish, this should fix your immediate issue.