()
| 327 | |
| 328 | |
| 329 | def _get_temp_root(): |
| 330 | global _support_default_root |
| 331 | if not _support_default_root: |
| 332 | raise RuntimeError("No master specified and tkinter is " |
| 333 | "configured to not support default root") |
| 334 | root = _default_root |
| 335 | if root is None: |
| 336 | assert _support_default_root |
| 337 | _support_default_root = False |
| 338 | root = Tk() |
| 339 | _support_default_root = True |
| 340 | assert _default_root is None |
| 341 | root.withdraw() |
| 342 | root._temporary = True |
| 343 | return root |
| 344 | |
| 345 | |
| 346 | def _destroy_temp_root(master): |