fix warnings for gtk

This PR aims to solve the warninigs for the gtk part.
Note that this PR does not intend to fix 64-bit related warnings. These will be followed up with another PR.