Hi there, i have following problem.
I have main window and there is button (GTK_STOCK_OPEN). The click calls the open function, where the file chooser dialog is made. I know how to get the filename and how to print it to standard output (terminal window). I also know how to pass the filename to system() command, This is my open function:
static void open(void)
filechooser = gtk_file_chooser_dialog_new ("Open File",
gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (filechooser), "/home/smaart/music");
if (gtk_dialog_run (GTK_DIALOG (filechooser)) == GTK_RESPONSE_ACCEPT)
char cmd ;
filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (filechooser));
sprintf (GString *cmd, "mplayer \"%s\"\n",filename);
But my task is to choose file, close the file chooser dialog and from the main window click on the play button, read the selected filename (e.g. from filename variable i have in open function) and run command mplayer "some filename". I'm beginner :) so be kind to me.
Thank you for your hints.