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

Method zoom_height

Lib/idlelib/zoomheight.py:33–58  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

31 return "break"
32
33 def zoom_height(self):
34 top = self.top
35
36 width, height, x, y = get_window_geometry(top)
37
38 if top.wm_state() != 'normal':
39 # Can't zoom/restore window height for windows not in the 'normal'
40 # state, e.g. maximized and full-screen windows.
41 return None
42
43 try:
44 maxheight, maxy = self.get_max_height_and_y_coord()
45 except WmInfoGatheringError:
46 return None
47
48 if height != maxheight:
49 # Maximize the window's height.
50 set_window_geometry(top, (width, maxheight, x, maxy))
51 return True
52 else:
53 # Restore the window's height.
54 #
55 # .wm_geometry('') makes the window revert to the size requested
56 # by the widgets it contains.
57 top.wm_geometry('')
58 return False
59
60 def get_max_height_and_y_coord(self):
61 top = self.top

Callers 1

zoom_height_eventMethod · 0.95

Calls 5

get_window_geometryFunction · 0.85
set_window_geometryFunction · 0.85
wm_stateMethod · 0.80
wm_geometryMethod · 0.80

Tested by

no test coverage detected