View on GitHub

IRAF Community Distribution

IRAF maintained by the community

Home | Installation | Packages | X11IRAF | PyRAF | Forum

clgcur gio example failed

alex wrote on Dec 06, 2006

Hi,
The example program on use of clgcur (see below) from gio manual
plots correctly but fails to display red cross cursor and to return wx,wy
coords, though it does return correct keystrokes. In an expanded
program, storing wx,wy and printing them only after gclose, I was getting
0, INDEF or 1E38 numbers for wx,wy

The =gcur run afterwards on the same plot works fine.

I would like to include some cursor input in my new/ near completed
Time Series Analysis contrib
package, in SPP/CL form. Otherwise, since
localy PyRAF is not used yet,
I would lack local support.

Thank you in advance for any clues.

Alex
============Parameter file========================
# parameters for pla
cur,*gcur,h,"",,,"Graphics input cursor"
============Sample program =============================
# from gio, expanded with data definition

include <gset.h>

task pla=t_pla

procedure t_pla

define NPLA 2
int npts
real data[NPLA],x1,x2

pointer gp
int wcs, key
char str[32]
real wx,wy

pointer gopen()
int clgcur()

begin
npts=NPLA
data[1]=2.
data[2]=3.
x1=-1.
x2=1.

# "stdgraph" doesn't work either
gp=gopen("xgterm", NEW_FILE, STDGRAPH)
call gploto(gp,data,npts,x1,x2,"data")
while (clgcur("cur",wx,wy,wcs,key,str,32)!=EOF) # no red cross present
if (key=='q') {
call gmark(gp, 0.5,2.5,GM_CIRCLE,1.,1.) # plots ok on exit
break
} else
call gmark(gp, wx,wy,GM_CIRCLE,1.,1.) # plots nothing
call gclose(gp)

end # t_pla test

Post generated using Mail2Forum (http://www.mail2forum.com)

Mike Fitzpatrick wrote on Dec 06, 2006

Alex,

Using your example program I get exactly the behavior I expect, i.e. a cursor is brought up and I can read it to mark circles or ultimately quit. If I add print statements I also see the values of the position/keystrokes as correct. Note that I'm using an XGterm window explicitly, if you're instead using an Xterm or something like a gnome-terminal/xrvt, then you should see some garbage printed to the screen. Changing you gopen() call to use 'stdgraph', and assuming you use an XTerm along with an xterm setting in the CL, the graphics should still work however you will not see a fullscreen cursor, and you may need to flush the graphics to see the plot properly. Your problems with the cursor read might similarly be explained by the cursor "losing synch" with the terminal, which is another shortcoming of the XTerm.

Anyway, I don't see a problem. Please post more information about your terminal setup.

Cheers,
-Mike

Last post on Dec 06, 2006