Formerly known as gui.cpp