Many thanks Ken!
I will try to implement it later, since I am under the pressure with another thing now, which must be finished ASAP! Your code is complex and precise
But, I thought about Mecej4 idea, tried it to simplify
and I got (during last night) an additional idea.
NOTE: all code is written in a MODULE except some lines in the MAIN program.
First, I abandoned the idea to write something into a BIN file. Instead,
in a subroutine which reads in the whole data set from the field (points with PointID,Y,X,H values) in a DO loop, I added INTEGER allocatable variables
for the purpose of comparison of real field data coordinates
with pixel coordinates transformed to real coordinates as follows:
...
body_mm: do v = 1,L
read (9,15) riadok_mm(v)
15 format(a)
read(riadok_mm(v),*)point_id_mm(v), y_mm(v), x_mm(v), h_mm(v)
y_mm(v) = y_mm(v) * (-1.0d0)
x_mm(v) = x_mm(v) * (-1.0d0)
y_mm_i(v) = nint(y_mm(v))
x_mm_i(v) = nint(x_mm(v))
end do body_mm
rewind (9)
....
I used the NINT function to have both real field data points
and real pixel coordinates as INTEGERS for subsequent comparison test.
In the call-back PL_CB which is invoked at the line
'%`^pl[full_mouse_input]&',gw,gh,npoints,y_ok,x_ok,y_mm,x_mm,handle_pl_mm,pl_cb)
AFTER the 3 directives
....
ylp = CLEARWIN_INFO@('GRAPHICS_MOUSE_X') ; xlp = CLEARWIN_INFO@('GRAPHICS_MOUSE_Y')
i = GET_PLOT_DATA@(ylp,xlp,ylr,xlr)
write (output_string(1),fmt(1)) ylr,',',xlr
I put the following code:
ylr_i = nint(ylr); xlr_i = nint(xlr)
terenne_suradnice_vs_pixelove_suradnice: DO v = 1,L
IF (ylr_i == y_mm_i(v) .and. xlr_i == x_mm_i(v)) then
write (output_string(3), fmt(2))'H= ',H_MM(v) ! Do pravouholnika v grafike sa vypise hodnota H_MM v zmysle formatu FMT(2)
END IF
END DO terenne_suradnice_vs_pixelove_suradnice
...
The result can be seen here:

However, this approach has two shortcomings - one minor (negligible), the other a little bit more serious.
The minor problem is, when I move with the mouse outside the graph, after moving back to the graph area - instead of a height value value
there are some unreadable charcters displayed which quickly change back to a height value, as soon as the cursor starts moving over blue points.
To avoid this, it is necessary not to move outside the graph area.
A little bit more serious problem stems (at least I suppose so) with the use of function NINT and with the precise clicking of the cursor.
I compared the displayed HEIGHT value and horizontal coordinates with the source TXT file from which the field data were read in. The HEIGHT value is OK, but horizontal coordinates are NOT exactly the same in the
display box as in the source TXT file (they differ) sometimes very
little, sometimes more (1-3 meters).
I could post full source code of the module and main program along
with necessary 3 input TXT files along with RCX file (since part
of the main menu was created in the designer %wi) and JPG file (logo).
During the development I got some ideas to enhance/improve the %PL
options. I will post it soon under ClearWin+ topic.
Thanks for potential comments!
Martin