An Introduction to Tkinter
前页 | Chapter 45. Toplevel Window Methods | 后页

# Window Geometry Methods

## geometry

`geometry()`. Returns a string describing self's "geometry". The string has the following format:

        "%dx%d%+d%+d" % (width, height, xoffset, yoffset)

where all coordinates are given in pixels.

## geometry

`geometry(geometry)`. Change the geometry for self. The string format is as described above.

## aspect

`aspect(minNumer, minDenom, maxNumer, maxDenom)`, `aspect()`. Control the aspect ratio (the relation between width and height) of this window. The aspect ratio is constrained to lie between minNumer/minDenom and maxNumer/maxDenom.

If no arguments are given, this method returns the current constraints as a 4-tuple, if any.

## maxsize

`maxsize(width, height)`, `maxsize()`. Set (get) the maximum size for this window.

## minsize

`minsize(width, height)`, `minsize()`. Set (get) the minimum size for this window.

## resizable

`resizable(width, height)`, `resizable()`. Set (get) the resize flags. The width flag controls whether the window can be resized horizontally by the user. The height flag controls whether the window can be resized vertically.

前页 | Home | 后页
Style Methods | Up | Icon Methods