Using getyx() from Curses library

Using getyx() from Curses library

Post by Matt Collin » Tue, 25 Apr 1995 04:00:00



Can someone mail me a small program to show me how to use the getyx() function
included from the curses library, my program tries to return the y value of the
cursor position but I get the following compiler errors and dont know what they mean:

part1.c:51: invalid type argument of `->'
part1.c:51: invalid type argument of `->'

int wherey(void)
{
        int x, y;
        getyx(0, y, x); /* This is the line the errors point to */
        return y;

Quote:}

What have I done wrong?  All I want is the y position of the cursor on the current
screen.

Any help would be appreciated!

Matthew.

 
 
 

Using getyx() from Curses library

Post by Dave Plon » Tue, 25 Apr 1995 04:00:00



> Can someone mail me a small program to show me how to use the getyx()
> function included from the curses library, my program tries to return the
> y value of the cursor position but I get the following compiler errors
> and dont know what they mean:
> part1.c:51: invalid type argument of `->'
> part1.c:51: invalid type argument of `->'
> int wherey(void)
> {
>    int x, y;
>    getyx(0, y, x); /* This is the line the errors point to */
>    return y;
> }
> What have I done wrong?  All I want is the y position of the cursor on
> the current screen.

My attempt to email failed:
   ----- Transcript of session follows -----
550 bradford.ac.uk (tcp)... Host unknown

Anyway...
getyx is usually a macro that dereferences the window pointer that is
passed as the first argument.  Ie. you shouldn't be passing 0.  You
probably mean to pass stdscr there.

BTW, what compiler/OS are you on that complains about dereferencing 0
at compile time?

Hope this helps!
Dave

--
------------------------------------------------------///--------------------
  Dave Plonka  ARS:N9HZF          Amiga - 68040 -    ///  486DLC-33 running

- Lead Systems Programmer, McHugh Freeman ------- \\X/- Waukesha, Wisconsin -

 
 
 

Using getyx() from Curses library

Post by StarTech Computer Servic » Thu, 27 Apr 1995 04:00:00




>Can someone mail me a small program to show me how to use the getyx() function
>included from the curses library, my program tries to return the y value of the
>cursor position but I get the following compiler errors and dont know what they mean:

>part1.c:51: invalid type argument of `->'
>part1.c:51: invalid type argument of `->'

>int wherey(void)
>{
>    int x, y;
>    getyx(0, y, x); /* This is the line the errors point to */
>    return y;
>}

>What have I done wrong?  All I want is the y position of the cursor on the current
>screen.

change to:
        getyx(stdscr,y,x);