code: def __GetMark(self):
          " keep track of cursor position within text"
          try:
              self.__mark = min(wx.TextCtrl.GetSelection(self)[0],
                                len(wx.TextCtrl.GetValue(self).strip()))
          except:
              self.__mark = f __GetMark(self):
          " keep track of cursor position within text"
          try:
              self.__mark = min(wx.TextCtrl.GetSelection(self)[0],
                                len(wx.TextCtrl.GetValue(self).strip()))
          except:
              self.__mark = 0
docs: keep track of cursor position within text