(self)
| 992 | return open_recent_file |
| 993 | |
| 994 | def saved_change_hook(self): |
| 995 | short = self.short_title() |
| 996 | long = self.long_title() |
| 997 | _py_version = ' (%s)' % platform.python_version() |
| 998 | if short and long and not macosx.isCocoaTk(): |
| 999 | # Don't use both values on macOS because |
| 1000 | # that doesn't match platform conventions. |
| 1001 | title = short + " - " + long + _py_version |
| 1002 | elif short: |
| 1003 | if short == "IDLE Shell": |
| 1004 | title = short + " " + platform.python_version() |
| 1005 | else: |
| 1006 | title = short + _py_version |
| 1007 | elif long: |
| 1008 | title = long |
| 1009 | else: |
| 1010 | title = "untitled" |
| 1011 | icon = short or long or title |
| 1012 | if not self.get_saved(): |
| 1013 | title = "*%s*" % title |
| 1014 | icon = "*%s" % icon |
| 1015 | self.top.wm_title(title) |
| 1016 | self.top.wm_iconname(icon) |
| 1017 | |
| 1018 | if macosx.isCocoaTk(): |
| 1019 | # Add a proxy icon to the window title |
| 1020 | self.top.wm_attributes("-titlepath", long) |
| 1021 | |
| 1022 | # Maintain the modification status for the window |
| 1023 | self.top.wm_attributes("-modified", not self.get_saved()) |
| 1024 | |
| 1025 | def get_saved(self): |
| 1026 | return self.undo.get_saved() |
no test coverage detected