Good resources for using Glade [Interface Designer] with Vala seem to be very sparse, and I'm having a difficult time getting started with Glade.
I did find a tutorial that seemed pretty good last year, but Ican no longer locate it.
Basically, I want to use Glade to do the GUI stuff, and then somehow "hook" it into my Vala code. How do we do this?
Glade generates a UI description in an XML format. GTK contains a class called Gtk.Builder
which reads this XML and constructs a widget hierarchy.
"Traditionally", the way to tie the two together is to give the widgets meaningful names in Glade, and then use widget = Gtk.Builder.get_object(name)
to grab the widget for use in your programme. You'll find quite a few examples like this on the web (google "vala gtkbuilder" or something similar to find them).
However, the latest versions of Vala and GTK have some new features to cut out quite a bit of the boilerplate from the way things have been done in the past. It's very new so you won't find many examples yet, but this blog post has all the details:
http://blogs.gnome.org/tvb/2013/05/29/composite-templates-lands-in-vala/