mirror of
https://github.com/python/cpython.git
synced 2025-11-01 06:01:29 +00:00
#1207589: Backwards-compatibility patch for right-click menu in IDLE.
This commit is contained in:
parent
8b2cd75bdd
commit
6b2918ae75
2 changed files with 10 additions and 2 deletions
|
|
@ -479,7 +479,12 @@ def right_menu_event(self, event):
|
||||||
if iswin:
|
if iswin:
|
||||||
self.text.config(cursor="arrow")
|
self.text.config(cursor="arrow")
|
||||||
|
|
||||||
for label, eventname, verify_state in self.rmenu_specs:
|
for item in self.rmenu_specs:
|
||||||
|
try:
|
||||||
|
label, eventname, verify_state = item
|
||||||
|
except ValueError: # see issue1207589
|
||||||
|
continue
|
||||||
|
|
||||||
if verify_state is None:
|
if verify_state is None:
|
||||||
continue
|
continue
|
||||||
state = getattr(self, verify_state)()
|
state = getattr(self, verify_state)()
|
||||||
|
|
@ -497,7 +502,8 @@ def right_menu_event(self, event):
|
||||||
|
|
||||||
def make_rmenu(self):
|
def make_rmenu(self):
|
||||||
rmenu = Menu(self.text, tearoff=0)
|
rmenu = Menu(self.text, tearoff=0)
|
||||||
for label, eventname, _ in self.rmenu_specs:
|
for item in self.rmenu_specs:
|
||||||
|
label, eventname = item[0], item[1]
|
||||||
if label is not None:
|
if label is not None:
|
||||||
def command(text=self.text, eventname=eventname):
|
def command(text=self.text, eventname=eventname):
|
||||||
text.event_generate(eventname)
|
text.event_generate(eventname)
|
||||||
|
|
|
||||||
|
|
@ -33,6 +33,8 @@ Library
|
||||||
IDLE
|
IDLE
|
||||||
----
|
----
|
||||||
|
|
||||||
|
- Issue #1207589: Backwards-compatibility patch for right-click menu in IDLE.
|
||||||
|
|
||||||
- Issue #16887: IDLE now accepts Cancel in tabify/untabify dialog box.
|
- Issue #16887: IDLE now accepts Cancel in tabify/untabify dialog box.
|
||||||
|
|
||||||
- Issue #17625: In IDLE, close the replace dialog after it is used.
|
- Issue #17625: In IDLE, close the replace dialog after it is used.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue