Example: Scale

public class Application : Gtk.Window {
public Application () {
// Prepare Gtk.Window:
this.title = "My Gtk.Scale";
this.window_position = Gtk.WindowPosition.CENTER;
this.destroy.connect (Gtk.main_quit);
this.set_default_size (350, -1);

// The button:
Gtk.Scale scale = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL, 0, 1, 0.1);
this.add (scale);

// Catch changes:
scale.value_changed.connect (() => {
print ("%f\n", scale.get_value ());
});
}

public static int main (string[] args) {
Gtk.init (ref args);

Application app = new Application ();
app.show_all ();
Gtk.main ();
return 0;
}
}

 valac --pkg gtk+-3.0 Gtk.Scale.vala

See: