title: My compound text does not refresh over my Tkinter image
body: <p>This is my first time using Tkinter and Python. I want to run a series of 4 images in a loop. The user interacts with the interface by clicking each image. My 4th image has a compound text which appears on it. I am unable to make this compound text disappear for when the program starts again. </p>
  
  <p>This is the line of code with initiates the compound text :</p>
  
  <pre><code>displayButton.configure(image=photo4, text = sc , compound=CENTER, fg = 'Black',      font='Verdana 30 bold', command=callback, wraplength=250, justify=CENTER)
  
  currentpicture=4
  </code></pre>
  
  <p>This is the code which configures the displayButton, but it does not work. </p>
  
  <pre><code>if currentpicture==4:
  displayButton.configure(image=photo1) 
  currentpicture=1
  </code></pre>
  
  <p>can anybody please help ?</p>
  
  <p>This is the complete code : </p>
  
  <pre><code>import sys
  import cwiid
  import time
  import math
  import numpy
  from Tkinter import*
  
  
  # declares the variable currentpicture to be 1
  currentpicture = 1
  
  lt = [None]*100
  lb = [None]*100
  rt = [None]*100
  rb = [None]*100 
  
  right_top_cal = 0
  left_top_cal = 0
  right_bottom_cal = 0
  left_bottom_cal = 0
  
  right_top = 0
  left_top = 0
  right_bottom = 0
  left_bottom = 0
  
  # defines the function for the callback button
  # declares the screen and currentpicture as global variables
  # checks the current picture and change it :) 
  
  def callback():
    global currentpicture
    global roundedresult
    global displayButton
    global sock
    global wiimote
    global comment 
  
    if currentpicture==4:
      displayButton.configure(image=photo1) 
      currentpicture=1
    if currentpicture==3:
      count = 0
      count2 = 0
      # Probably a good idea to have recently calibrated your Balance Board on your Wii
      balance_calibration = wiimote.get_balance_cal()
      # print balance_calibration
      right_top_cal = balance_calibration[0][0]
      right_bottom_cal = balance_calibration[1][0]
      left_top_cal = balance_calibration[2][0]
      left_bottom_cal = balance_calibration[3][0]
  
      print 'Calibration complete'
  
      while (count &lt;= 100):
          # Quite a slow refresh rate. Feel free to reduce this time (it's in seconds)
          time.sleep(0.1)
          wiimote.request_status()
  
          right_top = wiimote.state['balance']['right_top'] - right_top_cal
          right_bottom =  wiimote.state['balance']['right_bottom'] - right_bottom_cal
          left_top =  wiimote.state['balance']['left_top'] - left_top_cal
          left_bottom = wiimote.state['balance']['left_bottom'] - left_bottom_cal
  
          count2 += 1
          if (count2 &lt; 10):
              print 'wait'
  
          elif (count2 &gt;= 10):
              if (count &lt; 100):
                  lt[count] = left_top
                  lb[count] = left_bottom
                  rt[count] = right_top
                  rb[count] = right_bottom
                  count += 1
                  print left_top
              elif (count == 100):
                  result = ( numpy.std(lt, axis=0) + numpy.std(lb, axis=0) + numpy.std(rb,  axis=0) + numpy.std(rb, axis=0) )
                  print ('%.2f'%result)
                  roundedresult = ('%.2f'%result)
                  score = (1000 - float(roundedresult))
                  score2 = int(score)/90
                  score2 = ('%.2f'%score)
                  if score2 &lt;=3:
                      comment = 'Thanks for trying, have another go'
                  elif score2 &lt;=6:
                      comment = 'Not bad but room for improvement'
                  elif score2 &lt;=9:
                      comment  = 'Your Balance is great'
                  elif score2&gt;9:
                      comment = 'Balance Master'
                  sc= score2,comment
                  count += 1
      displayButton.configure(image=photo4, text = sc , compound=CENTER, fg = 'Black', font='Verdana 30 bold', command=callback, wraplength=250, justify=CENTER)
       currentpicture=4
  
    if currentpicture==2:
  
       # Wii Balance Board
      rpt_mode = 0
  
      # Change the number below to the Bluetooth MAC address of your Wii Balance Board
      # You get that by pressing red sync button in battery compartment and then running
      # hcitool scan  
      wiimote = cwiid.Wiimote("00:22:4C:42:06:C0")
  
      rpt_mode ^= cwiid.RPT_EXT
  
      wiimote.rpt_mode = rpt_mode
  
      print 'Pairing complete'
      displayButton.configure(image=photo3)
      currentpicture=3
  
  
    if currentpicture==1:
      roundedresult = None
      displayButton.configure(image=photo2, text=roundedresult, compound =CENTER)
      currentpicture=2
  
  root = Tk()
  photo1=PhotoImage(file='1.gif')
  photo2=PhotoImage(file='2.gif')
  photo3=PhotoImage(file='3.gif')
  photo4=PhotoImage(file='4.gif')
  displayButton=Button(None, text=None)
  displayButton.pack()
  
   # gives a size to the screen and places it in the center
   # gives a title to the screen
  
  root.geometry('320x240+0+0')
  root.title('BALANCE BOARD')
  
  ## removes decoration from the window 
  root.overrideredirect(1)
  displayButton['image']=photo1
  displayButton['command']=callback
  displayButton.pack
  
  #puts an image of height 240 into the label and packs it into an appropriate size 
  
  root.mainloop()
  </code></pre>