Learn R Programming

utils (version 3.4.1)

arrangeWindows: Rearrange windows in the R GUI.

Description

This function allows you to tile or cascade windows, or to minimize or restore them.

Usage

arrangeWindows(action, windows, preserve = TRUE, outer = FALSE)

Arguments

action

The action to perform on the windows. The choices are c("vertical", "horizontal", "cascade", "minimize", "restore") with default "vertical"; see the Details below for the interpretation. Abbreviations may be used.

windows

A list of window handles, by default produced by getWindowsHandles().

preserve

If TRUE, when tiling preserve the outer boundary of the collection of windows; otherwise make them as large as will fit.

outer

This argument is only used in MDI mode. If TRUE, tile the windows on the system desktop. Otherwise, tile them within the MDI frame.

Value

This function is called for the side effect of arranging the windows. The list of window handles is returned invisibly.

Details

The actions are as follows:

"vertical"

Tile vertically.

"horizontal"

Tile horizontally.

"cascade"

Cascade the windows.

"minimize"

Minimize all of the windows.

"restore"

Restore all of the windows to normal size (not minimized, not maximized).

The tiling and cascading are done by the standard Windows API functions, but unlike those functions, they will apply to all of the windows in the windows list.

By default, windows is set to the result of getWindowsHandles() (with one exception described below). This will select windows belonging to the current R process. However, if the global environment contains a variable named .arrangeWindowsDefaults, it will be used as the argument list instead. See the getWindowsHandles man page for a discussion of the optional arguments to that function.

When action = "restore" is used with windows unspecified, minimized = TRUE is added to the argument list of getWindowsHandles so that minimized windows will be restored.

In MDI mode, by default tiling and cascading will happen within the R GUI frame. However, if outer = TRUE, tiling is done on the system desktop. This will generally not give desirable results if any R child windows are included within windows.

See Also

getWindowsHandles

Examples

Run this code

arrangeWindows("v")
# This default is useful only in SDI mode:  it will tile any Firefox window 
# along with the R windows
.arrangeWindowsDefaults <- list(c("R", "all"), pattern = c("", "Firefox"))
arrangeWindows("v")

Run the code above in your browser using DataLab