MCPcopy Index your code
hub / github.com/python/cpython / init

Method init

Lib/idlelib/browser.py:103–132  ·  view source on GitHub ↗

Create browser tkinter widgets, including the tree.

(self)

Source from the content-addressed store, hash-verified

101 self.node.destroy()
102
103 def init(self):
104 "Create browser tkinter widgets, including the tree."
105 global file_open
106 root = self.master
107 flist = (pyshell.flist if not (self._htest or self._utest)
108 else pyshell.PyShellFileList(root))
109 file_open = flist.open
110 pyclbr._modules.clear()
111
112 # create top
113 self.top = top = ListedToplevel(root)
114 top.protocol("WM_DELETE_WINDOW", self.close)
115 top.bind("<Escape>", self.close)
116 if self._htest: # place dialog below parent if running htest
117 top.geometry("+%d+%d" %
118 (root.winfo_rootx(), root.winfo_rooty() + 200))
119 self.settitle()
120 top.focus_set()
121
122 # create scrolled canvas
123 theme = idleConf.CurrentTheme()
124 background = idleConf.GetHighlight(theme, 'normal')['background']
125 sc = ScrolledCanvas(top, bg=background, highlightthickness=0,
126 takefocus=1)
127 sc.frame.pack(expand=1, fill="both")
128 item = self.rootnode()
129 self.node = node = TreeNode(sc.canvas, None, item)
130 if not self._utest:
131 node.update()
132 node.expand()
133
134 def settitle(self):
135 "Set the window title."

Callers 2

__init__Method · 0.95
__init__Method · 0.45

Calls 15

settitleMethod · 0.95
rootnodeMethod · 0.95
updateMethod · 0.95
expandMethod · 0.95
ListedToplevelClass · 0.90
ScrolledCanvasClass · 0.90
TreeNodeClass · 0.90
protocolMethod · 0.80
winfo_rootxMethod · 0.80
winfo_rootyMethod · 0.80
CurrentThemeMethod · 0.80
GetHighlightMethod · 0.80

Tested by

no test coverage detected