AdaCore / gtkada

Ada bindings for the GTK+ graphical library.
Other
88 stars 19 forks source link

Gtkada.File_Selection raises error: unhandled signal #22

Open Lyaaaaaaaaaaaaaaa opened 5 years ago

Lyaaaaaaaaaaaaaaa commented 5 years ago

Good day, I'm trying to use Gtkada.File_Selection and its function File_Selection_Dialog for an application reading files. The package's description says

"This package provides a high level support for creating file selection dialogs by handling the signals internally"

However, when using it my program raises PROGRAM_ERROR : unhandled signal I tried to directly use Gtk.File_Chooser and Gtk.File_Chooser_dialog but it leads to the same error.

Here is the procedure called for selecting a file and leading to the error: Retour is an unbounded string

procedure Button_Select_File_Clicked (Self : access Gtk_Button_Record'Class) is begin

  Retour := To_Unbounded_String
    (File_Selection_Dialog (Title       => "Select your file",
                            Default_Dir => "",
                            Dir_Only    => False,
                            Must_Exist  => True) );

end Button_Select_File_Clicked;


Here is the full error message: Gtk-Message: 10:32:33.938: Failed to load module "pk-gtk-module" Gtk-Message: 10:32:33.938: Failed to load module "canberra-gtk-module" Gtk-Message: 10:32:33.939: Failed to load module "pk-gtk-module" Gtk-Message: 10:32:33.940: Failed to load module "canberra-gtk-module" Fontconfig warning: "/home/bob/Applications/Gnat_IDE/Gnat-community/etc/fonts/fonts.conf", line 86: unknown element "blank"

(log_filter_main:10478): Gtk-WARNING **: 10:32:36.273: Error loading theme icon 'image-missing' for stock: Failed to load /home/bob/Applications/Gnat_IDE/Gnat-community/share/icons/Adwaita/16x16/status/image-missing.png: Format d?image non reconnu

(log_filter_main:10478): Gdk-CRITICAL **: 10:32:36.273: gdk_cairo_surface_create_from_pixbuf: assertion 'GDK_IS_PIXBUF (pixbuf)' failed

(log_filter_main:10478): GLib-GObject-CRITICAL : 10:32:36.273: g_object_unref: assertion 'G_IS_OBJECT (object)' failed Gtk:ERROR:gtkiconhelper.c:494:ensure_surface_for_gicon: assertion failed (error == NULL): Failed to load /home/bob/Applications/Gnat_IDE/Gnat-community/share/icons/Adwaita/16x16/status/image-missing.png: Format d?image non reconnu (gdk-pixbuf-error-quark, 3) raised PROGRAM_ERROR : unhandled signal

I'm not sure if the problems come from Gtk or GtkAda. Thank you for your time.

PS: I attached some files in case you need it.

log_filter.zip

Lyaaaaaaaaaaaaaaa commented 5 years ago

I tested it on GPS 2019 and 2018 with GtkAda 2018 and 2019, it leads to the same problem. However, the program works well out of GPS environment.