MCPcopy Index your code
hub / github.com/python/cpython / var_changed_builtin_name

Method var_changed_builtin_name

Lib/idlelib/configdialog.py:767–784  ·  view source on GitHub ↗

Process new builtin theme selection. Add the changed theme's name to the changed_items and recreate the sample with the values from the selected theme.

(self, *params)

Source from the content-addressed store, hash-verified

765 self.set_highlight_target()
766
767 def var_changed_builtin_name(self, *params):
768 """Process new builtin theme selection.
769
770 Add the changed theme's name to the changed_items and recreate
771 the sample with the values from the selected theme.
772 """
773 old_themes = ('IDLE Classic', 'IDLE New')
774 value = self.builtin_name.get()
775 if value not in old_themes:
776 if idleConf.GetOption('main', 'Theme', 'name') not in old_themes:
777 changes.add_option('main', 'Theme', 'name', old_themes[0])
778 changes.add_option('main', 'Theme', 'name2', value)
779 self.theme_message['text'] = 'New theme, see Help'
780 else:
781 changes.add_option('main', 'Theme', 'name', value)
782 changes.add_option('main', 'Theme', 'name2', '')
783 self.theme_message['text'] = ''
784 self.paint_theme_sample()
785
786 def var_changed_custom_name(self, *params):
787 """Process new custom theme selection.

Callers 1

Calls 4

paint_theme_sampleMethod · 0.95
GetOptionMethod · 0.80
getMethod · 0.45
add_optionMethod · 0.45

Tested by

no test coverage detected