title: Tkinter button stays pressed
body: <p>I am making a tkinter code that uses button widget but when I press the button, it stays pushed until the function which is executed on button press is not completed. I want the button to be released immediately and execute the function.
  Here is a code that shows a good example of the happening:</p>
  <pre><code>from tkinter import *
  import time
  root = Tk()
  root.geometry('100x100+100+100') # size/position of root
  def callback(): # this function will run on button press
      print('Firing in 3')
      time.sleep(3) # wait for 3 seconds
  def main(): #function 'main'
      b = Button(root, text=&quot;ᖴIᖇE&quot;, width=10,height=2, command=callback)# setting the button
      b[&quot;background&quot;] = 'red' #button color will be red
      b[&quot;activebackground&quot;] = 'yellow'  #button color will be yellow for the time when the button will not be released
      b.place(x=25,y=25) #placing the button
  main() # using function 'main'
  mainloop()
  </code></pre>