Using Gobject callbacks instead of threads