title: Changing frame colour based on a condition check
body: <p>I am writing a tcl script to change the frame color based on license availability. If license is available it will show blue color else red color. This runs periodically(and frame color will be changed based on availability) using tcl every proc.</p>
  
  <p>But when i tried pack forget to redraw the frame, In consecutive loop it says widget already exists. I am not able to use configure command for frame color as its not supported. 
  Please suggest a solution.</p>
  
  <pre><code>#!/tools/tcl/tcl8.6/bin/tclsh -f
  
  package require Tk
  
  proc checkLic {} {
      set val [exec lmstat -a -c /tools/license/dat/cadence_orbit_3x.dat -f Liberate_MX_Client | grep issued | awk {{print $11}}]
      puts $val
      if {$val == 0} {
          after 1000
          pack forget .high
          after 1000
          frame  .high -width 8 -height 30 -background blue
          pack .high -side right
      } else {
          after 1000
          pack forget .high
          after 1000
          frame .high -width 8 -height 30 -background red
          pack .high -side right
      }
  }
  
  proc every {ms body} {
      eval $body
      after $ms [info level 0]
  }
  
  every 1000 {checkLic}
  </code></pre>