MCPcopy
hub / github.com/nltk/nltk / _layout

Method _layout

nltk/draw/tree.py:897–908  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

895 self._init_menubar()
896
897 def _layout(self):
898 i = x = y = ymax = 0
899 width = self._width
900 for i in range(len(self._widgets)):
901 widget = self._widgets[i]
902 (oldx, oldy) = widget.bbox()[:2]
903 if i % width == 0:
904 y = ymax
905 x = 0
906 widget.move(x - oldx, y - oldy)
907 x = widget.bbox()[2] + 10
908 ymax = max(ymax, widget.bbox()[3] + 10)
909
910 def _init_menubar(self):
911 menubar = Menu(self._top)

Callers 2

__init__Method · 0.95
resizeMethod · 0.95

Calls 2

moveMethod · 0.80
bboxMethod · 0.45

Tested by

no test coverage detected