Tools: MPW
Advanced Search
Apple Developer Connection
Member Login Log In | Not a Member? Support

MPW Command Reference


MoveWindow

Built-in

SYNTAX

MoveWindow [h v] [window] [-i]

DESCRIPTION

The MoveWindow command moves the upper-left corner of a window to the new location (h v). The coordinates (0,0) are located at the left side of the screen at the bottom of the menu bar.

If you specify a location that would place the window's title bar entirely off the visible screen, MoveWindow returns an error, although you can override the error by specifying the -i option.

INPUT

None

OUTPUT

None, unless you omit the window location (h v), in which case the location of the specified window is written to standard output as a MoveWindow command.

ALIAS RESOLUTION

This command resolves Finder aliases that are part of a partial or complete pathname substituted for the window name. The resolved pathname must specify the name of an open window. Note that using a Shell variable to designate a window is usually faster than requiring MPW to resolve a Finder alias.

STATUS

MoveWindow can return the following status codes:

0

no errors

1

syntax error (error in parameters)

2

specified window does not exist

3

invalid h v location

PARAMETERS

h v

Specifies the new window location, where h and v are horizontal and vertical pixels indicating the upper-left corner of the window. Use a space to separate the numbers h and v on the command line.

If you omit this parameter, the location of the specified window is written to standard output as a MoveWindow command.

window

Specifies the window to be moved to the new location. If you do not specify a window name, MoveWindow defaults to the target window.

OPTIONS

-i

Ignores errors relating to the window's position. This option allows you to place a window completely off screen. However, the position must still be within the range of -32,768 to 32,767.

EXAMPLES

The following command line moves the target window's upper-left corner to a point approximately 1 inch to the right of the upper-left corner of the screen, and 1 inch below the bottom of the menu bar. (There are approximately 72 pixels per inch on a Macintosh display screen.)

MoveWindow 72 72

If executed immediately after the previous command line, the command

MoveWindow

returns the location of the target window as a MoveWindow command:

MoveWindow 72 72

This command line moves the Worksheet window to its original position at the upper-left corner of the screen below the menu bar.

MoveWindow 0 0 "{Worksheet}"

SEE ALSO

HideWindows

RotateWindows

ShowWindows

SizeWindow

StackWindows

TileWindows

ZoomWindow

 
 


Last Updated July 2000