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

Method center

Lib/idlelib/editor.py:1045–1051  ·  view source on GitHub ↗
(self, mark="insert")

Source from the content-addressed store, hash-verified

1043 return "break"
1044
1045 def center(self, mark="insert"):
1046 text = self.text
1047 top, bot = self.getwindowlines()
1048 lineno = self.getlineno(mark)
1049 height = bot - top
1050 newtop = max(1, lineno - height//2)
1051 text.yview(float(newtop))
1052
1053 def getwindowlines(self):
1054 text = self.text

Callers 12

gotolineMethod · 0.95
center_insert_eventMethod · 0.95
formatdayMethod · 0.45
formatweekdayMethod · 0.45
formatmonthnameMethod · 0.45
formatyearMethod · 0.45
formatyearMethod · 0.45
formatstringFunction · 0.45
mdFunction · 0.45
xdFunction · 0.45
d3.min.jsFile · 0.45
buildMethod · 0.45

Calls 3

getwindowlinesMethod · 0.95
getlinenoMethod · 0.95
yviewMethod · 0.45

Tested by

no test coverage detected