parameters: (self)
docstring: Apply the theme colors to each element tag in the sample text.
  
          Instance attributes accessed:
              theme_elements
              theme_source
              builtin_name
              custom_name
  
          Attributes updated:
              highlight_sample: Set the tag elements to the theme.
  
          Methods:
              set_color_sample
  
          Called from:
              var_changed_builtin_name
              var_changed_custom_name
              load_theme_cfg
docstring_summary: Apply the theme colors to each element tag in the sample text.
docstring_tokens: Apply the theme colors to each element tag in the sample text .
function: def paint_theme_sample(self):
          """Apply the theme colors to each element tag in the sample text.
  
          Instance attributes accessed:
              theme_elements
              theme_source
              builtin_name
              custom_name
  
          Attributes updated:
              highlight_sample: Set the tag elements to the theme.
  
          Methods:
              set_color_sample
  
          Called from:
              var_changed_builtin_name
              var_changed_custom_name
              load_theme_cfg
          """
          if self.theme_source.get():  # Default theme
              theme = self.builtin_name.get()
          else:  # User theme
              theme = self.custom_name.get()
          for element_title in self.theme_elements:
              element = self.theme_elements[element_title][0]
              colors = idleConf.GetHighlight(theme, element)
              if element == 'cursor':  # Cursor sample needs special painting.
                  colors['background'] = idleConf.GetHighlight(
                          theme, 'normal')['background']
              # Handle any unsaved changes to this theme.
              if theme in changes['highlight']:
                  theme_dict = changes['highlight'][theme]
                  if element + '-foreground' in theme_dict:
                      colors['foreground'] = theme_dict[element + '-foreground']
                  if element + '-background' in theme_dict:
                      colors['background'] = theme_dict[element + '-background']
              self.highlight_sample.tag_config(element, **colors)
          self.set_color_sample()
function_tokens: def paint_theme_sample ( self ) : if self . theme_source . get ( ) : # Default theme theme = self . builtin_name . get ( ) else : # User theme theme = self . custom_name . get ( ) for element_title in self . theme_elements : element = self . theme_elements [ element_title ] [ 0 ] colors = idleConf . GetHighlight ( theme , element ) if element == 'cursor' : # Cursor sample needs special painting. colors [ 'background' ] = idleConf . GetHighlight ( theme , 'normal' ) [ 'background' ] # Handle any unsaved changes to this theme. if theme in changes [ 'highlight' ] : theme_dict = changes [ 'highlight' ] [ theme ] if element + '-foreground' in theme_dict : colors [ 'foreground' ] = theme_dict [ element + '-foreground' ] if element + '-background' in theme_dict : colors [ 'background' ] = theme_dict [ element + '-background' ] self . highlight_sample . tag_config ( element , * * colors ) self . set_color_sample ( )