loop on StyledTextCtrl_2 's OnUpdateUI demo

Hi all.

Robin Dunn,
If I insert this bit of code at the beginning of the method
OnUpdateUi StyledTextCtrl in demo it generates
a loop but only if I set it as stc.STC_LEX_PYTHON lexer
While this does not happen if lexer imposed stc.STC_LEX_SQL as:

 OnUpdateUI def (self, evt):
     print 'onupdateui'
     self.IndicatorSetStyle (1, stc.STC_INDIC_HIDDEN)
     self.StartStyling (0, stc.STC_INDICS_MASK)
     self.SetStyling (10, stc.STC_INDIC1_MASK)

     ...
···


Fabio Spadaro
www.fabiospadaro.com

If I remember correctly, the EVT_STC_UPDATEUI event is not supposed to be used for setting styles or doing things like modifying the content of the STC. Instead is is meant for doing things outside of the STC that need to react to state changes in the STC, such as displaying the current row/column in the status bar, enabling/disabling cut/copy/paste items in a toolbar or the menubar, etc.

···

On 3/8/11 5:13 AM, Fabio Spadaro wrote:

Hi all.
Robin Dunn,
If I insert this bit of code at the beginning of the method
OnUpdateUi StyledTextCtrl in demo it generates
a loop but only if I set it as stc.STC_LEX_PYTHON lexer
While this does not happen if lexer imposed stc.STC_LEX_SQL as:

      OnUpdateUI def (self, evt):
          print 'onupdateui'
          self.IndicatorSetStyle (1, stc.STC_INDIC_HIDDEN)
          self.StartStyling (0, stc.STC_INDICS_MASK)
          self.SetStyling (10, stc.STC_INDIC1_MASK)
          ...

--
Robin Dunn
Software Craftsman