how to find out the absolute position of the GUI element?

i am wondering how to get the x and y screen coordinates of the element that i am using
in GUI. the thing is that i used few nested GUI groups and i dont know how to get absolute
screen x and y position. is it possible?

If you are using the GUI class functions then you can get the absolute screen position of a nested element by adding its XY position to that of its parent element (and so on). You can get the position of a GUILayout element using the GUILayoutUtility.GetLastRect function although it may be tricky to use with nested elements, depending on what you are doing.

is there an automatic way of calculating that?
too bad there is no other easier way

Transform.TransformPoint : Will translate a point in localSpace to worldSpace.

Note that, if the parent object of a GUI-type object moves, it moves it’s position on the screen for some odd reason. In my opinion, most GUI objects are pretty awkwardly designed.