class_docstr: Delegator for syntax highlighting (text coloring).
  
  Instance variables:
      delegate: Delegator below this one in the stack, meaning the
              one this one delegates to.
  
      Used to track state:
      after_id: Identifier for scheduled after event, which is a
              timer for colorizing the text.
      allow_colorizing: Boolean toggle for applying colorizing.
      colorizing: Boolean flag when colorizing is in process.
      stop_colorizing: Boolean flag to end an active colorizing
              process.
class_docstr_tok: ["Delegator","for","syntax","highlighting","(","text","coloring",")",".","Instance","variables",":","delegate",":","Delegator","below","this","one","in","the","stack",",","meaning","the","one","this","one","delegates","to",".","Used","to","track","state",":","after_id",":","Identifier","for","scheduled","after","event",",","which","is","a","timer","for","colorizing","the","text",".","allow_colorizing",":","Boolean","toggle","for","applying","colorizing",".","colorizing",":","Boolean","flag","when","colorizing","is","in","process",".","stop_colorizing",":","Boolean","flag","to","end","an","active","colorizing","process","."]
docstr: Toggle colorizing on and off.
  
  When toggling off, if colorizing is scheduled or is in
  process, it will be cancelled and/or stopped.
  
  When toggling on, colorizing will be scheduled.
docstr_tok: ["Toggle","colorizing","on","and","off",".","When","toggling","off",",","if","colorizing","is","scheduled","or","is","in","process",",","it","will","be","cancelled","and\/or","stopped",".","When","toggling","on",",","colorizing","will","be","scheduled","."]
code: def toggle_colorize_event(self, event=None):
      """Toggle colorizing on and off.
  
      When toggling off, if colorizing is scheduled or is in
      process, it will be cancelled and/or stopped.
  
      When toggling on, colorizing will be scheduled.
      """
      if self.after_id:
          after_id = self.after_id
          self.after_id = None
          if DEBUG:
              print("cancel scheduled recolorizer")
          self.after_cancel(after_id)
      if self.allow_colorizing and self.colorizing:
          if DEBUG:
              print("stop colorizing")
          self.stop_colorizing = True
      self.allow_colorizing = not self.allow_colorizing
      if self.allow_colorizing and not self.colorizing:
          self.after_id = self.after(1, self.recolorize)
      if DEBUG:
          print(
              "auto colorizing turned",
              "on" if self.allow_colorizing else "off",
          )
      return "break"
  
imports: import builtins
  import keyword
  import re
  import time
  from idlelib.config import idleConf
  from idlelib.delegator import Delegator
label_desc: Use image node_id 10 for calling the ColorDelegator obj's underlying member method code with example usage: obj.toggle_colorize_event(event) and returns: str