(self)
| 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 |
no test coverage detected