merge code from cocoGUi