filebrowser set starting dir?

  • st_claire

    st_claire - 2007-08-23

    How can I set the starting directory for the filebrowser?


    • Andrea Tagliasacchi

      I solved the problem (at least it works for me).

      Code example:
      GLUI_FileBrowser* fb = new GLUI_FileBrowser(IO_panel, "", GLUI_PANEL_EMBOSSED, -1, handler_filebrowser);


    • st_claire

      st_claire - 2007-08-27

      Just tried your code with fb->fbreaddir("c:/");, but nothing was different. Any thoughts?

      Thanks :)

      • Andrea Tagliasacchi

        try to use a relative path (w.r.t. the executable).
        I used for example "./smf/" and it worked perfectly.


    • st_claire

      st_claire - 2007-08-27

      Still nothing.

      fileBrowser = new GLUI_FileBrowser( file_selection, "Filename", GLUI_PANEL_EMBOSSED );


      • Billy B

        Billy B - 2007-08-28

        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.


    • Andrea Tagliasacchi

      I am interested too..
      Perhaps baxissimo would be able to answer?



Log in to post a comment.

Get latest updates about Open Source Projects, Conferences and News.

Sign up for the SourceForge newsletter:

No, thanks