here i meant, how is the textbox click done, it assume a object under the text drawn, or some grid like position
It is an object, and then the rest of using the step/draw gui event to determine where your mouse is when you click again. Hope that answers your question :)