I have a simple program that reads and displays an image file using DISPLAY_DIB_BLOCK@. It works just fine.
I now want to use the mouse to get a few pixel positions in the image, but seem to be caught in a catch-22. If I call clearwin_info@ to get the mouse flags and the x and y coordinates before the widow is closed, I don't see the image or the mouse cursor. If I close the image window first, then I can't get the mouse position and the program hangs.
...
kontrol = 0
i=winio@('%gr%lw&',nx1,ny1,kontrol)
CALL display_dib_block@(0,0,dib,nx1,ny1,0,0,nx1,ny1,0,0,ierr)
i=winio@('%nl%^bt[CLOSE]','EXIT')
iflags=0
10 iflags = clearwin_info@ ('GRAPHICS_MOUSE_FLAGS')
if (iflags.ne.1) goto 10
mousex = clearwin_info@ ('GRAPHICS_MOUSE_X')
mousey = clearwin_info@ ('GRAPHICS_MOUSE_Y')
...
nx1, ny1 are the image dimensions that I got from a previous call to get_dib_size@ and the image file itself was imported using get_dib_block@
What am I doing wrong?