({{, (RefLink[CreateWindow, paclet:ref/CreateWindow])[]
creates an empty window in the front end.}, {, (RefLink[CreateWindow, paclet:ref/CreateWindow])[expr] 
creates a window displaying the notebook expression expr, and opens it in the front end.}, {, (RefLink[CreateWindow, paclet:ref/CreateWindow])[expr,obj]
replaces the notebook represented by the notebook object obj with the one obtained from expr.}})

OpenersNotesSection(Spacer1)Details and Options

The notebook expression expr can be (RefLink[DocumentNotebook, paclet:ref/DocumentNotebook]), (RefLink[PaletteNotebook, paclet:ref/PaletteNotebook]), or (RefLink[DialogNotebook, paclet:ref/DialogNotebook]).

(RefLink[CreateWindow, paclet:ref/CreateWindow]) can take any notebook option.

(RefLink[CreateWindow, paclet:ref/CreateWindow])[(RefLink[Visible, paclet:ref/Visible])->(RefLink[False, paclet:ref/False])] creates a new invisible window.

(RefLink[CreateWindow, paclet:ref/CreateWindow])[expr,obj] overwrites the entire contents of the notebook represented by the notebook object obj. »

OpenersPrimaryExamplesSection(Spacer1)Examples  (14)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Create a blank notebook window:

CreateWindow[];

Create a notebook window with specified contents:

nb=CreateWindow[DocumentNotebook[{a,b,c}]];

Replace the contents of an existing window:

CreateWindow[DocumentNotebook[{1,2}],nb];

OpenersExampleSection1(Spacer1)Scope  (2)

Create a palette window:

CreateWindow[PaletteNotebook[{"Square root",Button[(Sqrt[π]),p=N[(Sqrt[π])]]}]];

Create a dialog window:

CreateWindow[DialogNotebook[{TextCell["Enter a name: "],InputField[Dynamic[nm],String],DefaultButton[DialogReturn[ret=nm]]}]];

OpenersExampleSection2(Spacer1)Options  (5)

OpenersExampleSubsection0(Spacer1)Background  (1)

Set a background color:

CreateWindow[DocumentNotebook[{a,b}],Background->RGBColor[1,.9,.7]];

OpenersExampleSubsection1(Spacer1)CellDingbat  (1)

Set a cell dingbat:

CreateWindow[DocumentNotebook[{a,b}],CellDingbat->"\[MathematicaIcon]"];

OpenersExampleSubsection2(Spacer1)CellGrouping  (1)

Make a notebook with manually grouped cells:

CreateWindow[DocumentNotebook[{CellGroup[{a,b}],c}],CellGrouping->Manual];

OpenersExampleSubsection3(Spacer1)TextAlignment  (1)

Align contents on the right:

CreateWindow[DocumentNotebook[{a,b}],TextAlignment->Right];

OpenersExampleSubsection4(Spacer1)Visible  (1)

Create a notebook that is not visible:

nb=CreateWindow[DocumentNotebook[{a,b}],Visible->False];

Make the notebook appear:

SetOptions[nb,Visible->True]

OpenersExampleSection3(Spacer1)Properties & Relations  (5)

(RefLink[DocumentNotebook, paclet:ref/DocumentNotebook]) creates an in-cell representation of a notebook document:

DocumentNotebook[{x+y,1/x+1/y}]

(RefLink[CreateWindow, paclet:ref/CreateWindow]) puts the document into its own window:

CreateWindow[%];

(RefLink[PaletteNotebook, paclet:ref/PaletteNotebook]) and (RefLink[DialogNotebook, paclet:ref/DialogNotebook]) create representations of specialized notebooks:

PaletteNotebook[{PasteButton[Grid[{{a,b},{c,d}}]]}]

DialogNotebook[{TextCell[Row[{"Your name:",InputField[]}]]}]

Use (RefLink[CreateWindow, paclet:ref/CreateWindow]) to put a palette or dialog expression into its own notebook window:

CreateWindow[%];

(RefLink[CreateDocument, paclet:ref/CreateDocument]) is essentially a combination of (RefLink[DocumentNotebook, paclet:ref/DocumentNotebook]) and (RefLink[CreateWindow, paclet:ref/CreateWindow]):

CreateDocument[{x+y,1/x+1/y}];

(RefLink[CreatePalette, paclet:ref/CreatePalette]) acts like a combination of (RefLink[PaletteNotebook, paclet:ref/PaletteNotebook]) and (RefLink[CreateWindow, paclet:ref/CreateWindow]):

CreatePalette[{"Square root",Button[(Sqrt[π]),p=N[(Sqrt[π])]]}];

(RefLink[CreateDialog, paclet:ref/CreateDialog]) acts like a combination of (RefLink[DialogNotebook, paclet:ref/DialogNotebook]) and (RefLink[CreateWindow, paclet:ref/CreateWindow]):

CreateDialog[{"Click OK to close",DefaultButton[]}];

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[CreateDocument, paclet:ref/CreateDocument])  ▪  (RefLink[CreateNotebook, paclet:ref/CreateNotebook])  ▪  (RefLink[CreatePalette, paclet:ref/CreatePalette])  ▪  (RefLink[CreateDialog, paclet:ref/CreateDialog])  ▪  (RefLink[NotebookPut, paclet:ref/NotebookPut])  ▪  (RefLink[WindowMargins, paclet:ref/WindowMargins])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Low-Level Notebook Programming, paclet:guide/LowLevelNotebookProgramming])}})}})