mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
bpo-34120: fix text viewer to call grab_release() only when needed (GH-8616)
This commit is contained in:
parent
10ea9409ce
commit
dd74369cb7
1 changed files with 4 additions and 2 deletions
|
|
@ -83,7 +83,8 @@ def __init__(self, parent, title, text, modal=True,
|
|||
command=self.ok, takefocus=False)
|
||||
self.viewframe.pack(side='top', expand=True, fill='both')
|
||||
|
||||
if modal:
|
||||
self.is_modal = modal
|
||||
if self.is_modal:
|
||||
self.transient(parent)
|
||||
self.grab_set()
|
||||
if not _utest:
|
||||
|
|
@ -91,7 +92,8 @@ def __init__(self, parent, title, text, modal=True,
|
|||
|
||||
def ok(self, event=None):
|
||||
"""Dismiss text viewer dialog."""
|
||||
self.grab_release()
|
||||
if self.is_modal:
|
||||
self.grab_release()
|
||||
self.destroy()
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue