How can I put a list of filenames into an editor menu?

The EditorGUILayout.Popup method displays a drop-down menu so the user can select from a list of strings. However, any slashes in the option strings are converted into another level of child menu. This is cool when you want nested menus, not so cool when you're trying to give the user a list of filenames to choose from.

Is there a way to prevent this behaviour? Or other suggestions on how to easily throw a drop-down menu into my EditorWindow?

An array of GUIContents won't work either, alas. You can replace "`/`" with "" instead (i.e, the fraction slash character with a space before and after, instead of the standard slash).

Turns out backslashes work fine, so I'm converting front-slashes to backslashes for use as menu options, then converting the result back to front-slashes when I use the filename (redundant under Windows, where either slash works for the file system API's, but needed on Mac).

I did notice a few times when backslashes seemed NOT to work, but I believe this was because my editor window class was not being fully reinitialized as I was modifying its code and recompiling. (Seems odd, but I'm not going to bother investigating.)