Create popup, do not return until tk widget destroyed. parent - parent of this dialog title - string which is title of popup dialog _htest - bool, change box location when running htest _utest - bool, don't wait_window when running unittest
(self, parent, title=None, *, _htest=False, _utest=False)
| 24 | |
| 25 | """ |
| 26 | def __init__(self, parent, title=None, *, _htest=False, _utest=False): |
| 27 | """Create popup, do not return until tk widget destroyed. |
| 28 | |
| 29 | parent - parent of this dialog |
| 30 | title - string which is title of popup dialog |
| 31 | _htest - bool, change box location when running htest |
| 32 | _utest - bool, don't wait_window when running unittest |
| 33 | """ |
| 34 | Toplevel.__init__(self, parent) |
| 35 | self.configure(borderwidth=5) |
| 36 | # place dialog below parent if running htest |
| 37 | self.geometry("+%d+%d" % ( |
| 38 | parent.winfo_rootx()+30, |
| 39 | parent.winfo_rooty()+(30 if not _htest else 100))) |
| 40 | self.bg = "#bbbbbb" |
| 41 | self.fg = "#000000" |
| 42 | self.create_widgets() |
| 43 | self.resizable(height=False, width=False) |
| 44 | self.title(title or |
| 45 | f'About IDLE {pyver} ({bits} bit)') |
| 46 | self.transient(parent) |
| 47 | self.grab_set() |
| 48 | self.protocol("WM_DELETE_WINDOW", self.ok) |
| 49 | self.parent = parent |
| 50 | self.button_ok.focus_set() |
| 51 | self.bind('<Return>', self.ok) # dismiss dialog |
| 52 | self.bind('<Escape>', self.ok) # dismiss dialog |
| 53 | self._current_textview = None |
| 54 | self._utest = _utest |
| 55 | |
| 56 | if not _utest: |
| 57 | self.deiconify() |
| 58 | self.wait_window() |
| 59 | |
| 60 | def create_widgets(self): |
| 61 | frame = Frame(self, borderwidth=2, relief=SUNKEN) |
nothing calls this directly
no test coverage detected