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