I had to read the GTK+ code recently to have an example. https://bugzilla.gnome.org/show_bug.cgi?id=736914