Posts

Showing posts with the label vala

Starting to learn Vala

Starting to learn Vala I have decided to learn Vala. Instructions are here. Hello Dbus: Everyone starts with "Hello World." I did too. Little is gained by repeating it. So here is something different. Here is my first dbus introspection in vala: // This vala file is named dbus-introspection.vala [DBus (name = "org.freedesktop.DBus.Introspectable")] // Dbus interface interface Introspectable : Object { [DBus (name = "Introspect")] // Dbus method public abstract string introspect() throws IOError; } void main () { Introspectable conn = null; // If inside the try, causes fail try { conn = Bus.get_proxy_sync (BusType.SESSION, // Dbus session "org.freedesktop.Notifications", // Dbus destination "/org/freedesktop/Notifications"); // Dbus path string reply = conn.introspect(); // the actual event stdout.printf ("%s ", reply); // print response } catch (IOError response) { // print error stderr.printf ("IO Error: %s ...