Check out
Using Tk::Text and '<<Modified>>'. Some of the pitfalls of using <<Modified>> are discussed. I did this once before and ended up using md5sums to detect changes. You can bind to <Enter> and <Leave> on widgets, and do md5sums for comparison.