TextViewer.py
changeset 687 629680fb0582
parent 684 f10449b18dbe
child 696 8865c406f616
equal deleted inserted replaced
686:3216bf5f711d 687:629680fb0582
   245     
   245     
   246     def GetState(self):
   246     def GetState(self):
   247         return {"cursor_pos": self.Editor.GetCurrentPos()}
   247         return {"cursor_pos": self.Editor.GetCurrentPos()}
   248     
   248     
   249     def SetState(self, state):
   249     def SetState(self, state):
   250         self.Editor.GotoPos(state.get("cursor_pos", 0))
   250         if self:
       
   251             self.Editor.GotoPos(state.get("cursor_pos", 0))
   251         
   252         
   252     def OnModification(self, event):
   253     def OnModification(self, event):
   253         if not self.DisableEvents:
   254         if not self.DisableEvents:
   254             mod_type = event.GetModificationType()
   255             mod_type = event.GetModificationType()
   255             if mod_type&wx.stc.STC_MOD_BEFOREINSERT:
   256             if mod_type&wx.stc.STC_MOD_BEFOREINSERT: