> For the complete documentation index, see [llms.txt](https://zeanfender11.gitbook.io/graycrown-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zeanfender11.gitbook.io/graycrown-docs/script-and-apis/gcwindowinitializer-constructor.md).

# GCWindowInitializer() constructor

### About the constructor

Creates a constructor that creates a Graycrown child window instance.

```
GCWindowInitializer(url, width, height)
```

`url` = the designated URL (mandatory, object type: string)

`width` = the intended width (optional, object type: integer)

`height` = the intended height (optional, object type: integer)

#### Example:

```javascript
const window = new GCWindowInitializer('https://example.com', 1024, 600)
```

### Functions

#### `GCWindowInitializer().OpenWindow()`

Opens the window alongside the intended URL.

#### Use case

```javascript
const window = new GCWindowInitializer('https://example.com', 1024, 600)
// Onclick event firing here is just an example, you may replace with
// various other JavaScript on-based events.
button.onclick = () => {
    window.OpenWindow()
}
```

#### `GCWindowInitializer().ChangeURL(url)` (WIP, planned)

Changes the URL to another URL, then `OpenWindow()` can be fired.

`url` = Designated URL (mandatory)

#### Use case

```javascript
const window = new GCWindowInitializer('https://example.com', 1024, 600)
// Onclick event firing here is just an example, you may replace with
// various other JavaScript on-based events.
button.onclick = () => {
    window.ChangeURL('https://example2.com');
    // ChangeURL only changes the URL, it does not fire the
    // OpenWindow() function by default. You have to call and fire
    // the function again to reopen the window with a different URL
    window.OpenWindow()
}
```
