# OnSceneGUI In Editor Window

This is how you can get [OnSceneGUI](https://docs.unity3d.com/ScriptReference/Editor.OnSceneGUI.html "https://docs.unity3d.com/ScriptReference/Editor.OnSceneGUI.html") features like [Handles](https://docs.unity3d.com/ScriptReference/Handles.html "https://docs.unity3d.com/ScriptReference/Handles.html") to work on [EditorWindows](https://docs.unity3d.com/ScriptReference/EditorWindow.html "https://docs.unity3d.com/ScriptReference/EditorWindow.html").

[![Unity&#95;5HY3oXTJJj.png](https://vrclibrary.com/wiki/uploads/images/gallery/2022-12/scaled-1680-/unity-5hy3oxtjjj.png)](https://vrclibrary.com/wiki/uploads/images/gallery/2022-12/unity-5hy3oxtjjj.png)

```c#
private void OnEnable()
{
  	// Ensure that there is no delegate callback
  	SceneView.duringSceneGui -= OnSceneGUI;
  
  	// Define the callback for the delegate
  	SceneView.duringSceneGui += OnSceneGUI;
}

private void OnDestroy()
{
  	// After the editor window is destroyed, remove the callback
  	SceneView.duringSceneGui -= OnSceneGUI;
}

private void OnSceneGUI(SceneView sceneView)
{
	// Here you can use OnSceneGUI features like Handles
}
```