Update the additional help entries on the Help menu.
(self)
| 909 | type='int') |
| 910 | |
| 911 | def reset_help_menu_entries(self): |
| 912 | """Update the additional help entries on the Help menu.""" |
| 913 | help_list = idleConf.GetAllExtraHelpSourcesList() |
| 914 | helpmenu = self.menudict['help'] |
| 915 | # First delete the extra help entries, if any. |
| 916 | helpmenu_length = helpmenu.index(END) |
| 917 | if helpmenu_length > self.base_helpmenu_length: |
| 918 | helpmenu.delete((self.base_helpmenu_length + 1), helpmenu_length) |
| 919 | # Then rebuild them. |
| 920 | if help_list: |
| 921 | helpmenu.add_separator() |
| 922 | for entry in help_list: |
| 923 | cmd = self._extra_help_callback(entry[1]) |
| 924 | helpmenu.add_command(label=entry[0], command=cmd) |
| 925 | # And update the menu dictionary. |
| 926 | self.menudict['help'] = helpmenu |
| 927 | |
| 928 | def _extra_help_callback(self, resource): |
| 929 | """Return a callback that loads resource (file or web page).""" |
no test coverage detected