Next: , Previous: , Up: Frame Properties   [Contents][Index]


39.2.4 Frame Size And Position

You can read or change the size and position of a frame using the frame properties left, top, height, and width. Whatever geometry properties you don’t specify are chosen by the window manager in its usual fashion.

Here are some special features for working with sizes and positions:

Function: set-frame-position frame left top

This function sets the position of the top left corner of frame to left and top. These arguments are measured in pixels, and count from the top left corner of the screen. Negative property values count up or rightward from the top left corner of the screen.

Function: frame-height &optional frame
Function: frame-width &optional frame

These functions return the height and width of frame, measured in lines and columns. If you don’t supply frame, they use the selected frame.

Function: frame-pixel-height &optional frame
Function: frame-pixel-width &optional frame

These functions return the height and width of frame, measured in pixels. If you don’t supply frame, they use the selected frame.

Function: set-frame-size frame cols rows &optional pretend

This function sets the size of frame, measured in characters; cols and rows specify the new width and height. (If pretend is non-nil, it means that redisplay should act as if the frame’s size is cols by rows, but the actual size of the frame should not be changed. You should not normally use this option.)

You can also use the functions set-frame-height and set-frame-width to set the height and width individually. The frame is the first argument and the size (in rows or columns) is the second. (There is an optional third argument, pretend, which has the same purpose as the corresponding argument in set-frame-size.)


Next: , Previous: , Up: Frame Properties   [Contents][Index]