Possible to create new GUILayout elements?

I was wondering if it was possible to create new UI elements which could be used with GUILayout and if so, is there any resource/guideline for doing so?

There are a few elements I want to create with varying complexity. One of the simple examples would be popups. I want to create a custom UI element for a popup that can be used with automatic layouts. Something like

GUILayout.BeginArea(the area I want my popups confined to)
foreach popup I am displaying at the moment
GUILayout.PopUp(“Title string”, “ContentString”);
GUILayout.EndArea()

The popup itself is a glorified box with some custom controls (a close button in the upper-left, and various option buttons depending on what type of popup it is along the bottom).

Is this possible? Or should I just do the math manually and use GUI. instead of GUILayout. ?

Thanks in advance for any input/advice!

Just bumping the thread, I’m very curious about this as well.

After digging through the docs, EventType.Layout and GUILayoutUtility.GetLastRect look promising.

There isn’t any “user area” type of control available for you to implement your own GUI elements. However, you can sometimes do things like this by drawing a texture and getting clicks in the control rectangle with the help of GUILayoutUtility.GetLastRect.