# OnGUI(Rect)

> This is the main GUI method of the TreeView, where the TreeViewItems are processed and drawn.

## Definition

* **Type:** Method
* **Namespace:** [UnityEditor.IMGUI.Controls](/engine/6000.5/script-reference/unityeditor/imgui/controls.md)
* **Assembly:** UnityEditor.CoreModule

```csharp
public virtual void OnGUI(Rect rect)
```

### Parameters

**** (\[Rect]\(/engine/6000.5/script-reference/unityengine/rect)): Rect where the TreeView is rendered.

### Remarks

Call this at the point at which the TreeView should be rendered in the given Rect. If the TreeView is constructed with a [MultiColumnHeader](/engine/6000.5/script-reference/unityeditor/imgui/controls/multicolumnheader.md) the header is included in the rect provided.
