Merge with 3.5

This commit is contained in:
Terry Jan Reedy 2016-06-11 02:06:40 -04:00
commit b5c43f4c01
2 changed files with 85 additions and 1 deletions

View file

@ -1403,6 +1403,17 @@ class PseudoInputFile(PseudoFile):
self.shell.close()
def fix_x11_paste(root):
"Make paste replace selection on x11. See issue #5124."
if root._windowingsystem == 'x11':
for cls in 'Text', 'Entry', 'Spinbox':
root.bind_class(
cls,
'<<Paste>>',
'catch {%W delete sel.first sel.last}\n' +
root.bind_class(cls, '<<Paste>>'))
usage_msg = """\
USAGE: idle [-deins] [-t title] [file]*
@ -1535,8 +1546,10 @@ def main():
'editor-on-startup', type='bool')
enable_edit = enable_edit or edit_start
enable_shell = enable_shell or not enable_edit
# start editor and/or shell windows:
root = Tk(className="Idle")
root.withdraw()
# set application icon
icondir = os.path.join(os.path.dirname(__file__), 'Icons')
@ -1551,7 +1564,7 @@ def main():
root.wm_iconphoto(True, *icons)
fixwordbreaks(root)
root.withdraw()
fix_x11_paste(root)
flist = PyShellFileList(root)
macosx.setupApp(root, flist)