Fix compilation with GTK+ older than 2.18

Based on patch by @mckaygerhard. Fixes #2.