Partly rewritten to use GTK# now