Working gtk gui shares same code with console version