I'm trying to create an application with GtkAda and need the user to select a file from his PC. However, I found no way to create a file chooser without leading to this error: raised PROGRAM_ERROR : unhandled signal.
Using Glade 3.22.1
I tried creating a file chooser button and link it to a file chooser dialog. It leads to the same error.
Without Glade
I tried creating a file chooser dialog and file chooser button in GPS but same error.
Then I found the Gtkada.File_Selection package. Its description says it handles himself the signals and only needs a single function. Sadly, it leads to the same fateful error.
I'm working on Fedora 29. GtkAda version 2018, GPS 2018 and GNAT 8.3.1.
Log_Filter_Handlers.ads
with Gtkada.File_Selection; use Gtkada.File_Selection;
package Log_Filter_Handlers is
Retour : Unbounded_String;
procedure Button_Select_File_Clicked
(Self : access Gtk_Button_Record'Class);
end Log_Filter_Handlers;
Log_Filter_Handlers.adb
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;
Gtkada-File_Selection.ads
package Gtkada.File_Selection is
function File_Selection_Dialog
(Title : Glib.UTF8_String := "Select File";
Default_Dir : String := "";
Dir_Only : Boolean := False;
Must_Exist : Boolean := False) return String;
end Gtkada.File_Selection;
As soon as the application creates a file chooser widget (be it dialog or button), in this case by calling Button_Select_File_Clicked. It immediately leads to this error:
raised PROGRAM_ERROR : unhandled signal
I'm having some warnings too
Gtk-Message: 10:43:33.615: Failed to load module "pk-gtk-module"
Gtk-Message: 10:43:33.615: Failed to load module "canberra-gtk-module"
Gtk-Message: 10:43:33.616: Failed to load module "pk-gtk-module"
Gtk-Message: 10:43:33.616: 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:24417): Gtk-WARNING **: 10:43:33.841: Could not load a pixbuf from icon theme.
This may indicate that pixbuf loaders or the mime database could not be found.
Thank you.