How to call GUILayer methods outside of OnGUI() in supporting methods?

To explain the question a little better, I’m creating a custom editor window and it has a few tabs using a toolbar. I use a switch statement to delegate between which GUI is drawn on the screen. In an effort to prevent making a monolithic function for drawing all the elements in the window, I’ve attempted to delegate the gui creation to methods, however they don’t seem to be drawing the GUI at all, despite Debug.Log()'s working perfectly fine when the methods are called.

Example code of what I’m doing:

//..
using UnityEditor;
using UnityEngine;

public class ExampleWindowWithTabs : EditorWindow
{

string[] tabOptions = {"Tab 1", "Tab 2"};
int currentTab = 0;
void OnGUI()
{
     int tab = GUILayout.Toolbar(currentTab, tabOptions);
     this.DelegateTabs(tab);
}
void DelegateTabs(int tab)
{
         if(tab != this.currentTab)
         {
             switch(tab)
             {
                 case 0:
                     this.DisplayTabOne();
                     break;
                 case 1:
                     this.DisplayTabTwo();
                     break;
                 default:
                     break;
             }
             this.currentTab = tab;
         }
}
void DisplayTabOne()
{
     Debug.Log("Tab 1 selected");
     // This doesn't work
     GUILayout.Label("Tab 1 selected");
}
void DisplayTabTwo()
{
     Debug.Log("Tab 2 selected");
     // Neither does this.
     GUILayout.Label("Tab 2 selected");
}
}

However, if i lumped all this code into the OnGUI() method instead of splitting it into separate methods, it works.

This is mildly frustrating because the editor window I’m creating will be very difficult to maintain if it all just sits in a single method. Is there any way to get this to work like I have it shown above, or am I just going to have to tough it out? Thanks for any feedback!

Alright I feel very silly here. I didn’t realize that OnGUI() is similar to the Update() method in that it more or less updates the GUI each frame it’s active. The check if(tab != this.currentTab){..} is what was breaking it for me: it would set it for a single frame, then the next frame it would not draw it again. I’ll be leaving this here for any future person starting out in custom Editor scripts to learn from my mistakes.