added the basic gui connection, now the function could work primarily,
thanks to the effor of MingRui Zhang