2

I use GTK3 , codeblcks IDE, glade3 in windows 7...

In my application i have a button which when clicked should open a gtk_file_chooser_dialog... But gives the fillowing error..

Glib-GIO-ERROR**:No GSettings schemas are installed on the system

static void on_save_clicked(GtkWidget *widget,gpointer data)
{
GtkWidget *dialog;
//dialog=gtk_file_chooser_dialog_new("Save it",GTK_WINDOW(gtk_builder_get_object(builder,"mainwindow")),GTK_FILE_CHOOSER_ACTION_SAVE,GTK_STOCK_OK,GTK_RESPONSE_OK,GTK_STOCK_CANCEL,GTK_RESPONSE_CANCEL);
//dialog=GTK_FILE_CHOOSER_DIALOG(gtk_builder_get_object(builder,"filechooserdialog"));
gtk_widget_show_all(dialog);
gint resp=gtk_dialog_run(GTK_DIALOG(dialog));
if(resp==GTK_RESPONSE_OK)
g_print("%s\n",gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog)));
}

I use g_signal_connect(...) to call this function when the button is clicked...

I cannot understand the problem...

user3745626
  • 21
  • 1
  • 2
  • I forgot to mention...The error shows both of the time when using any of the commented lines... – user3745626 Jun 23 '14 at 15:58
  • Go to this page:[http://stackoverflow.com/questions/37916185/hot-to-fix-error-glib-gio-error-no-gsettings-schemas-are-installed-on-the-sy/37916581#37916581](http://stackoverflow.com/questions/37916185/hot-to-fix-error-glib-gio-error-no-gsettings-schemas-are-installed-on-the-sy/37916581#37916581) –  Jun 20 '16 at 07:26

3 Answers3

2

I got the very same error when trying to open a FileChooserDialog.

    (lancer_ihm.py:1047004): GLib-GIO-CRITICAL **: g_settings_schema_source_lookup: assertion 'source != NULL' failed

    (lancer_ihm.py:1047004): GLib-GIO-ERROR **: No GSettings schemas are installed on the system
    Trace/breakpoint trap (core dumped)

I 'm running a Gtk3 interface with python3 on Linux. Gtk3 and all its dependencies were installed from the sources.

I found the solution on this forum http://forum.tinycorelinux.net/index.php?topic=13699.0

I just set XDG_DATA_DIRS variable with the path to where the gtk schema files are located and it works.

    $ ls /home/user1/ctcils/dusserm/applications/gtk/3.12.1/share/glib-2.0/schemas/
    gschemas.compiled         org.gtk.exampleapp.gschema.xml             org.gtk.Settings.FileChooser.gschema.xml
    org.gtk.Demo.gschema.xml  org.gtk.Settings.ColorChooser.gschema.xml

    $ export XDG_DATA_DIRS=/Produits/publics/x86_64.Linux.RH6/glib/2.40.0/share/:/home/user1/ctcils/dusserm/applications/gtk/3.12.1/share/ 
Michael Dussere
  • 498
  • 7
  • 25
0

There are probably few errors in there.

  1. If you commented both, the dialog.show_all () will produce error because, it hasn't been instantiate yet you asked to be shown.
  2. If you use the first one, object Gtk.FileChooserDialog param has to end with NULL (in c), read the doc
  3. If you use the second one, check your glade signal property in your glade window
  4. Check your gtk installation
luciomrx
  • 1,165
  • 1
  • 7
  • 7
0

Quoting from this StackOverflow answer,

Seems you're not the one having this problem, and it also happens on Windows on MinGW. Luckily, that person gave a solution:

The thing, as it seems as I was running the test-widget example (that I built with gtksourceview-3.0.0 using MSVC), was that I need to compile the org.gtk.Settings.FileChooser.gschema.xml file (from GTK+-3.x, under $(srcroot)/gtk) with the glib-compile-schemas utility that is from GLib, which will generate gschemas.compiled in the same folder.

After that, place that gschemas.compiled file in the this folder: $(parent_folder_of_the_gtk3_dll)\share\glib-2.0\schemas and one will be set to use the gtkfilechooser without the puzzling

[GLib-GIO-ERROR **: Settings schema 'org.gtk.Settings.FileChooser' is not installed] error.

I will add to my GLib project files to compile the glib-compile-schemas utility and add to my GTK+-3.x project files to compile the the org.gtk.Settings.FileChooser.gschema.xml shortly.

Community
  • 1
  • 1
user12205
  • 2,684
  • 1
  • 20
  • 40