I'm trying to write an application in Vala, and have looked up in the Vala documentation how to work with GLib.Settings (dconf). Getting and setting values works. However, when I try to detect changes to the schema or a specific key using the changed
event, the event simply does not fire.
Example: http://pastebin.com/dGuP9GyX
The changed event will never fire for some reason. The bind ()
method does not work either (only in one direction).
Forget the example below... It actually does work when you add \n, for some reason...
Here's a small example to illustrate. Compile with the following command; valac --pkg gio-2.0 --pkg gtk+-3.0 main.vala
int main (string[] args)
{
Gtk.init (ref args);
GLib.Settings settings = new GLib.Settings ("org.pantheon.terminal.settings");
settings.changed["allow-bold"].connect (somethingChanged);
Gtk.main ();
return 0;
}
void somethingChanged ()
{
stdout.printf ("Something changed");
}
When running this small example, in my case anyway, the program will just keep running. No matter how many settings I change in the specified dconf schema, it will not output anything.
Hoping someone can help me get past this barrier.
robin@RobinJ:~$ valac --version
Vala 0.20.1