[#8815] Segfault in libc strlen, via rb_str_new2 — "Sean E. Russell" <ser@...>

Howdy,

12 messages 2006/09/09
[#8817] Re: Segfault in libc strlen, via rb_str_new2 — Eric Hodel <drbrain@...7.net> 2006/09/09

On Sep 8, 2006, at 10:10 PM, Sean E. Russell wrote:

Curses problem

From: "Overdorf, Sam" <sam.overdorf@...>
Date: 2006-09-16 00:02:15 UTC
List: ruby-core #8884
I have been trying to use the "Curses" library and am having the
following problem.

I am using the O'reilly book "Programming with curses" as a tutorial.

 

I try to position the cursor on the screen and it doesn't seem to work
correctly.

I tried the same thing in "c" and everything seems to work ok so I know
I have the syntax correct.

 

Here is a piece of the code:

 

screen = Curses.init_screen()

 

y = x = 0

 

while x <= 24

  move(y,x)

  addstr("yx is here")

  x += 1

  y += 1

end

 

screen.refresh()

 

screen.getch()

 

screen.close_screen()

 

 

I was looking at the "curses.c" file and it looks like the move function
is calling the wrong thing.

According to my book the "mvwin" is for moving windows on the screen and
not for cursor addressing.

 

Thanks for the help,

Sam Overdorf

 

/* def move(y, x) */

static VALUE

window_move(obj, y, x)

    VALUE obj;

    VALUE y;

    VALUE x;

{

    struct windata *winp;

    

    GetWINDOW(obj, winp);

    mvwin(winp->window, NUM2INT(y), NUM2INT(x));

 

    return Qnil;

}

In This Thread

Prev Next