> > in <fltk/file_chooser.h>, I found use_system_file_chooser, it can use WIN32 
> > GetOpenFileName to get a file open/save dialog box.
> > Well, under Linux, How can I do?
> >
>
> Go to Erco's Cheat Sheet
>
> http://seriss.com/people/erco/fltk/
>
> Near the bottom of this page is a link to Fl_Native_File_Chooser
>
> This should give you what you want.

Thank you. Following above link, I got Fl_Native_File_Chooser.
After reading source codes, It seems having native File_Chooser for Windows and 
Mac OS, but no Linux.

Under Fedora Linux, I have tried GTK open file dialg,

static void cb_button(fltk::Button*, void*) {
 GtkWidget *dialog;
 char sFileName[255 + 1] = "";
 gtk_init(NULL, NULL);
 dialog = gtk_file_chooser_dialog_new ("Save File",
                        NULL, /* here have problem */
                        GTK_FILE_CHOOSER_ACTION_SAVE,
                        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
                        GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
                        NULL);

 if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) {
   char *filename = NULL;
   filename = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (dialog));
   if (filename != NULL) strcpy(sFileName, filename);
   g_free (filename);
 }

  gtk_widget_destroy (dialog);
  fltk::message("%s", sFileName);
}

these can get filename, but with problem: open dialog box holding.

_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk

Reply via email to