How to create a dialog to open files with the SDL library?

1

I'm making a very simple audio player in C (in Ubuntu) for a college job, and I'm using the SDL library to create windows (graphical interface) along with the SDL_mixer to play the audio.

The problem is: I need a way for the user to point the music file that he wants to play, type a dialog box that would return the directory of the file chosen by the user so that I could pass it on, to the SDL_mixer and run it.

On the internet I only found some tutorials in C # for Windows.

Any ideas?

    
asked by anonymous 15.02.2014 / 22:03

1 answer

3

You can install GTK+ (also in C) and use it to show File Chooser Dialog , where the user will select the music file. From here on you can do with SDL same.

Some references:

To install GTK:

apt-get install libgtk2.0-dev
    
15.02.2014 / 22:39