# IOverlayParent

`com.jsmacrosce.wagyourgui.overlays.IOverlayParent`

Parent contract for overlay operations in the WagYourGUI hierarchy, implemented by `BaseScreen` and `OverlayContainer`.  
 ```js
const Client = Java.type("com.jsmacrosce.jsmacros.client.JsMacrosClient");  
const parent = Client.prevScreen;  
if (parent !== null) {
  Chat.log(parent.getChildOverlay() !== null);  
}
 ```

## Methods

### closeOverlay {#com.jsmacrosce.wagyourgui.overlays.IOverlayParent_closeOverlay-OverlayContainer-}

```js
closeOverlay(OverlayContainer overlay): void
```

Requests that the given overlay be closed through this hierarchy.

**Parameters:**
- `overlay`: overlay to close in this hierarchy

### getChildOverlay {#com.jsmacrosce.wagyourgui.overlays.IOverlayParent_getChildOverlay-}

```js
getChildOverlay(): OverlayContainer
```

Returns the deepest nested overlay.

**Returns:** the deepest overlay, or this overlay when the receiver has no child, or `null` when a screen has no overlay

### setFocused {#com.jsmacrosce.wagyourgui.overlays.IOverlayParent_setFocused-GuiEventListener-}

```js
setFocused(GuiEventListener focused): void
```

Sets the focused GUI listener for the owning screen.

**Parameters:**
- `focused`: listener to focus, or `null` to clear focus
