How can I set the starting directory for the filebrowser?
I solved the problem (at least it works for me).
GLUI_FileBrowser* fb = new GLUI_FileBrowser(IO_panel, "", GLUI_PANEL_EMBOSSED, -1, handler_filebrowser);
Just tried your code with fb->fbreaddir("c:/");, but nothing was different. Any thoughts?
try to use a relative path (w.r.t. the executable).
I used for example "./smf/" and it worked perfectly.
fileBrowser = new GLUI_FileBrowser( file_selection, "Filename", GLUI_PANEL_EMBOSSED );
This funtionality is not part of the current filebrowser design.
If you really need it, I recommend taking a look at glui_filebrowser.cpp and figuring out how to add it.
There's not a lot of code there.
But looking at the code it does look like calling fbreaddir should do it I don't know why it isn't for you. Do any of "test/", "./test", "test" ".\test\", ".\test", or "test\" work? Does a directory called 'test' actually exist? Note that MSVC often doesn't start your app up in the directory where you think it would.
BTW looking at the code closer, I can also see that my earlier suggestion of using current_dir to get the current directory will not work at all. current_dir is always "." and never changes.
I am interested too..
Perhaps baxissimo would be able to answer?
Log in to post a comment.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.