Graphics should not be drawn directly to the screen. Instead areas should be reserved using Gadgets in the resource file. Another way to draw graphics is to create a graphical pop up window. In the latter case X-Y coordinates inside such a window are relative to the window corner.
Files for the sample application: