This commit is contained in:
ton
2024-10-07 10:13:40 +07:00
parent aa1631742f
commit 3a7d696db6
9729 changed files with 1832837 additions and 161742 deletions

View File

@@ -166,8 +166,9 @@ class EditorWindow:
text.bind("<3>",self.right_menu_event)
text.bind('<MouseWheel>', wheel_event)
text.bind('<Button-4>', wheel_event)
text.bind('<Button-5>', wheel_event)
if text._windowingsystem == 'x11':
text.bind('<Button-4>', wheel_event)
text.bind('<Button-5>', wheel_event)
text.bind('<Configure>', self.handle_winconfig)
text.bind("<<cut>>", self.cut)
text.bind("<<copy>>", self.copy)
@@ -913,7 +914,7 @@ class EditorWindow:
def ApplyKeybindings(self):
"""Apply the virtual, configurable keybindings.
Alse update hotkeys to current keyset.
Also update hotkeys to current keyset.
"""
# Called from configdialog.activate_config_changes.
self.mainmenu.default_keydefs = keydefs = idleConf.GetCurrentKeySet()
@@ -1043,7 +1044,9 @@ class EditorWindow:
def saved_change_hook(self):
short = self.short_title()
long = self.long_title()
if short and long:
if short and long and not macosx.isCocoaTk():
# Don't use both values on macOS because
# that doesn't match platform conventions.
title = short + " - " + long + _py_version
elif short:
title = short
@@ -1058,6 +1061,13 @@ class EditorWindow:
self.top.wm_title(title)
self.top.wm_iconname(icon)
if macosx.isCocoaTk():
# Add a proxy icon to the window title
self.top.wm_attributes("-titlepath", long)
# Maintain the modification status for the window
self.top.wm_attributes("-modified", not self.get_saved())
def get_saved(self):
return self.undo.get_saved()
@@ -1748,6 +1758,7 @@ def _editor_window(parent): # htest #
# Does not stop error, neither does following
# edit.text.bind("<<close-window>>", edit.close_event)
if __name__ == '__main__':
from unittest import main
main('idlelib.idle_test.test_editor', verbosity=2, exit=False)