Thanks a lot. Seems that you better understood than me what
GTK_FILE_CHOOSER is. :-)
Your code works fine and that's the only thing that matters.
Cheers.
> Hi Julien,
> This code works for me:
> gtk_init (argc, argv)
> title$ = "Open file"
> dialog = gtk_file_chooser_dialog_new (&title$, NULL, $
> $GTK_FILE_CHOOSER_ACTION_OPEN, &$$GTK_STOCK_CANCEL, $
> $GTK_RESPONSE_CANCEL, &$$GTK_STOCK_OPEN, $$GTK_RESPONSE_ACCEPT, NULL)
> IF (gtk_dialog_run (dialog) = $$GTK_RESPONSE_ACCEPT) THEN
> filename = gtk_file_chooser_get_filename_utf8 (dialog)
> PRINT CSTRING$(filename)
> 'open_file (filename);
> 'g_free (filename);
> END IF
> gtk_widget_destroy (dialog)
> a$ = INLINE$("Press ENTER to exit")
> As you see, you will have to use gtk_file_chooser_get_filename_utf8
> instead of gtk_file_chooser_get_filename
> (see gtkfilechooser.h
> /* Reserve old names for DLL ABI backward compatibility */
> #define gtk_file_chooser_get_filename
> gtk_file_chooser_get_filename_utf8
> )
> As far I understand GTK_FILE_CHOOSER is a macro that cast the dialog
> pointer.
> (
> #define GTK_TYPE_FILE_CHOOSER_DIALOG
> (gtk_file_chooser_dialog_get_type ())
> #define GTK_FILE_CHOOSER_DIALOG(obj)
> (G_TYPE_CHECK_INSTANCE_CAST ((obj), GTK_TYPE_FILE_CHOOSER_DIALOG,
> GtkFileChooserDialog))
> )
> To be onest, I am using Common Dialog Controls for this kind of
> situations (and when I know the program will run only on Win32).
> Hope this helps more than confuse..
> Cheers,
> Liviu