# create-frame(2)

[Home] [Commands] [Variables] [Macro-Dev] [Glossary]

## NAME

create-frame - Create a new frame

## SYNOPSIS

n create-frame (C-x 5 1, C-x 5 2)

## INTODUCTION

A frame in MicroEmacs is the screen canvas on which all of the windows are attached. MicroEmacs allows the creation of new frames, creating a new blank canvas, which may be populated with new windows. Frames may be swapped and the window layout for a given frame is preserved until the frame is displayed again. There are two types of frame:

Internal

An internal frame uses the same display window (or console) hiding any other frames. On creation, any existing frame is hidden and a new frame blank takes its place. Internal frames are supported on all platforms.

External

An external frame creates a new display window allowing both the original frame and new frame to be visible in different windows. External frames are only available on windowing platforms such as X-Windows and Microsoft Windows. External frames may include internal frames which are paged.

This is shown in the following diagram:-

             +-----------------+           +-----------------+
             |                 +-+         |                 +-+
             |                 | +-+       |                 | |
             |                 | | |       |                 | |
             |                 | | |       |                 | |
             +-+---------------+ | |       +-+---------------+ |
               +-+---------------+ |         +-----------------+
                 +-----------------+

              Three Internal Frames        External Frame with
                                           two internal frames

The user may move to the next frame using next-frame(2) which swaps the current frame for the next frame. External frames may also be accessed via the window manager by selecting the window.

A frame may be subsequently deleted with delete-frame(2).

## DESCRIPTION

create-frame creates a new frame for the current MicroEmacs session, the new frame is assigned a unique identity $frame-id(5) which exists for the life of the frame.

The numeric argument n defines the type of frame to be created. An argument of `2` creates an external frame, an internal frame is created with an argument of `1`. Where no argument is specified an external frame is created by default on systems which support them otherwise an internal frame is created.

## NOTES

MicroEmacs is not multi-threaded and only one frame may be active at any one time (the complexity of being able to run a command in one frame while editing in another would rapidly lead it away from the 'Micro' status). Therefore if a command is left active (such as a search) in one frame and the focus is changed to another frame the input is sent to the frame with the active command and the message `[NOT FOCUS]` appears in the message-line of the frame with the focus.

create-frame is useful in macros that rely on a window layout, as the macro can preserve the users current window layout by creating a new internal frame in which to run.

## SEE ALSO

delete-frame(2), next-frame(2), $frame-id(5).

(c) Copyright JASSPA 2009
Last Modified: 2009/08/29
Generated On: 2009/10/12

</HMTL>