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

Class ScrolledText

Lib/tkinter/scrolledtext.py:20–42  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

18
19
20class ScrolledText(Text):
21 def __init__(self, master=None, **kw):
22 self.frame = Frame(master)
23 self.vbar = Scrollbar(self.frame)
24 self.vbar.pack(side=RIGHT, fill=Y)
25
26 kw['yscrollcommand'] = self.vbar.set
27 Text.__init__(self, self.frame, **kw)
28 self.pack(side=LEFT, fill=BOTH, expand=True)
29 self.vbar['command'] = self.yview
30
31 # Copy geometry methods of self.frame without overriding Text
32 # methods -- hack!
33 text_meths = vars(Text).keys()
34 methods = vars(Pack).keys() | vars(Grid).keys() | vars(Place).keys()
35 methods = methods.difference(text_meths)
36
37 for m in methods:
38 if m[0] != '_' and m != 'config' and m != 'configure':
39 setattr(self, m, getattr(self.frame, m))
40
41 def __str__(self):
42 return str(self.frame)
43
44
45def example():

Callers 1

exampleFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…