Show the tabbed dialog for user configuration. Args: parent - parent of this dialog title - string which is the title of this popup dialog _htest - bool, change box location when running htest _utest - bool, don't wait_window when running unit
(self, parent, title='', *, _htest=False, _utest=False)
| 47 | """ |
| 48 | |
| 49 | def __init__(self, parent, title='', *, _htest=False, _utest=False): |
| 50 | """Show the tabbed dialog for user configuration. |
| 51 | |
| 52 | Args: |
| 53 | parent - parent of this dialog |
| 54 | title - string which is the title of this popup dialog |
| 55 | _htest - bool, change box location when running htest |
| 56 | _utest - bool, don't wait_window when running unittest |
| 57 | |
| 58 | Note: Focus set on font page fontlist. |
| 59 | |
| 60 | Methods: |
| 61 | create_widgets |
| 62 | cancel: Bound to DELETE_WINDOW protocol. |
| 63 | """ |
| 64 | Toplevel.__init__(self, parent) |
| 65 | self.parent = parent |
| 66 | if _htest: |
| 67 | parent.instance_dict = {} |
| 68 | if not _utest: |
| 69 | self.withdraw() |
| 70 | |
| 71 | self.title(title or 'IDLE Preferences') |
| 72 | x = parent.winfo_rootx() + 20 |
| 73 | y = parent.winfo_rooty() + (30 if not _htest else 150) |
| 74 | self.geometry(f'+{x}+{y}') |
| 75 | # Each theme element key is its display name. |
| 76 | # The first value of the tuple is the sample area tag name. |
| 77 | # The second value is the display name list sort index. |
| 78 | self.create_widgets() |
| 79 | self.resizable(height=FALSE, width=FALSE) |
| 80 | self.transient(parent) |
| 81 | self.protocol("WM_DELETE_WINDOW", self.cancel) |
| 82 | self.fontpage.fontlist.focus_set() |
| 83 | # XXX Decide whether to keep or delete these key bindings. |
| 84 | # Key bindings for this dialog. |
| 85 | # self.bind('<Escape>', self.Cancel) #dismiss dialog, no save |
| 86 | # self.bind('<Alt-a>', self.Apply) #apply changes, save |
| 87 | # self.bind('<F1>', self.Help) #context help |
| 88 | # Attach callbacks after loading config to avoid calling them. |
| 89 | tracers.attach() |
| 90 | |
| 91 | if not _utest: |
| 92 | self.grab_set() |
| 93 | self.wm_deiconify() |
| 94 | self.wait_window() |
| 95 | |
| 96 | def create_widgets(self): |
| 97 | """Create and place widgets for tabbed dialog. |
nothing calls this directly
no test coverage detected