title: How to find the mouse cursor index
body: <p>Hi I wrote a script with the "undotext" widget,
  and I'm looking for a way to get the line index of the palce where the mouse cursor is standing.</p>
  
  <p>and similarly when the user has select part of the line.</p>