How to get EditorGUI.CurveEditor into a window?

Hi in the inspector for certain components you can see and interact with the curve editor inside the inspector like this
alt text

When I try to do the same in my own custom Editor Window I instead get this

alt text

It just draws what the curve looks like and when I click the image of the curve it opens the editor in a new window.

How can I embed the curve editor into my EditorWindow like the inspector does?

I cropped the image of my editor because of my company logo and stuff like that.

Just create a variable of type AnimationCurve and you’ll get the editor behaviour as in your first picture.

public AnimationCurve myCurve;