How do I add a drop-down menu to an EditorWindow?

I want to add a drop-down menu to my custom EditorWindow. Something like either the Unity File menu, or even better, the "Create" menu in the Project editor. I've looked through all the GUI and EditorGUI controls, and none of them look like a drop-down menu to me. Perhaps it's a "Popup" with a very customized style?

Does anybody know?

I found that a mixed of the above answers was required to get the editor-style menu strip at the top of an EditorWindow:

void OnGUI() {



void DrawToolStrip() {
    if (GUILayout.Button("Create...", EditorStyles.toolbarButton)) {


    if (GUILayout.Button("Tools", EditorStyles.toolbarDropDown)) {
        GenericMenu toolsMenu = new GenericMenu();

        if (Selection.activeGameObject != null)
            toolsMenu.AddItem(new GUIContent("Optimize Selected"), false, OnTools_OptimizeSelected);
            toolsMenu.AddDisabledItem(new GUIContent("Optimize Selected"));


        toolsMenu.AddItem(new GUIContent("Help..."), false, OnTools_Help);

        // Offset menu from right of editor window
        toolsMenu.DropDown(new Rect(Screen.width - 216 - 40, 0, 0, 16));

void OnMenu_Create() {
    // Do something!

void OnTools_OptimizeSelected() {
    // Do something!

void OnTools_Help() {

See EditorGUI.Popup on scripting reference for using popups in editor scripts.

Alteratively EditorUtility.DisplayPopupMenu might do what you want but I have never used it. It seems to be customizable through EditorGUIUtility.LookLikeControls.

Ok, I refer this a newbie question but as a developer state, and not as newbie question in general. I'm also still considered as noobs!

Here I will create a menu that will automatically added into your Unity.

Unity JavaScript - JS

  1. Create new folder and rename it as "Editor"
  2. On the folder you just create right click and Create > JavaScript
  3. There will be a new file and rename it as "SemutMenu"
  4. Right click the newly created and renamed file to edit it (choose edit).
  5. Withing your editor, clear all then copy and paste below code..

    import System.IO; class SemutMenu extends EditorWindow {

    @MenuItem ("Semut/Menu One")
    static function ShowWindow () {
        EditorWindow.GetWindow (SemutMenu);


  6. Now after you SAVE IT, you will have new menu that appear on the Semut > Menu One

  7. That will be all!