added "gui" method to check whether Pd is run with a gui