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)
| 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. |
no test coverage detected