differentiate gui depth

I have two scripts,
In script one, it draws a GUI.button and when I click on it. it invokes a function in script two, which draw file browser dialog using GUILayout.
It does the drawings, the only problem is that the file browser is drawn behind the GUI.button.

I tried several way to set GUI.depth. But it seems don’t work.

Any solution will be appreciated!

GUI.depth sometimes works strange. I could suggest your to use GUI.Window() as workaround.