On Wed, Oct 03, 2012 at 10:23:12PM +0200, Nicola Fontana wrote:
> I need to catch when the file has changed in a
> GtkFileChooserButton. I thought connecting to "file-set" was
> enough but this signal is not emitted when the user cancels
> (although bug 555351 does not agree [1]). Here is the proof:
> 
> 
> #include <gtk/gtk.h>
> 
> int main(int argc, char **argv)
> {
>     GtkWidget *window, *chooser;
> 
>     gtk_init(&argc, &argv);
> 
>     window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
>     chooser = gtk_file_chooser_button_new(NULL,
>                                           GTK_FILE_CHOOSER_ACTION_OPEN);
>     gtk_container_add(GTK_CONTAINER(window), chooser);
> 
>     g_signal_connect_swapped(chooser, "file-set",
>                              G_CALLBACK(g_print), "file-set\n");
> 
>     gtk_widget_show_all(window);
>     gtk_main();
> 
>     return 0;
> }
> 
> 
> What am I supposed to do? I can provide my custom dialog to
> GtkFileChooserButton but checking when the file has changed in a
> file chooser seems a too natural request for requiring such
> effort.
>
Well, I'm not 100% sure what you mean (and that "callback" of yours
looks like it's only working by chance), but the change on cancel was
recently fixed in bug 645065 in regard of gtk 3.4 and 3.6 (unfortunately, not 
in 2.24 though, even if it seems to be only a matter of a cherry-pick).

_______________________________________________
gtk-app-devel-list mailing list
gtk-app-devel-list@gnome.org
https://mail.gnome.org/mailman/listinfo/gtk-app-devel-list

Reply via email to