| # Sample extension: zoom a window to maximum height |
| from idlelib import macosxSupport |
| ('_Zoom Height', '<<zoom-height>>'), |
| def __init__(self, editwin): |
| def zoom_height_event(self, event): |
| m = re.match(r"(\d+)x(\d+)\+(-?\d+)\+(-?\d+)", geom) |
| width, height, x, y = map(int, m.groups()) |
| newheight = top.winfo_screenheight() |
| if sys.platform == 'win32': |
| newheight = newheight - 72 |
| elif macosxSupport.runningAsOSXApp(): |
| # The '88' below is a magic number that avoids placing the bottom |
| # of the window below the panel on my machine. I don't know how |
| # to calculate the correct value for this with tkinter. |
| newheight = newheight - newy - 88 |
| #newheight = newheight - 96 |
| newheight = newheight - 88 |
| newgeom = "%dx%d+%d+%d" % (width, newheight, x, newy) |