Skip to content

Commit

Permalink
check for formw, return long
Browse files Browse the repository at this point in the history
  • Loading branch information
gauteh committed Nov 20, 2013
1 parent 25ade76 commit 4481f31
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 6 deletions.
2 changes: 1 addition & 1 deletion examples/form_get_wch.rb
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
Ncurses::Form.form_driver(form, Ncurses::Form::REQ_END_LINE);
else
# If this is a normal character, it gets Printed
Ncurses::Form.form_driver(form, ch.ord)
Ncurses::Form.form_driver(form, ch)
end
end

Expand Down
4 changes: 3 additions & 1 deletion extconf.rb
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,9 @@

puts "checking for the form library..."
if have_header("form.h")
have_library("formw", "new_form")
if not have_library("formw", "new_form")
raise "formw library not found"
end
else
raise "form library not found."
end
Expand Down
5 changes: 1 addition & 4 deletions ncurses_wrap.c
Original file line number Diff line number Diff line change
Expand Up @@ -923,10 +923,7 @@ static int my_wget_wch (WINDOW *c_win) {
* and second element the key code */
static VALUE rbncurshelper_nonblocking_wget_wch(WINDOW *c_win) {
int retcode = rbncurshelper_do_wgetch_functor (c_win, &my_wget_wch);
//char c_str[2];
//c_str[0] = wget_wch_back;
//c_str[1] = 0;
VALUE r = rb_assoc_new (INT2NUM(retcode), rb_str_new((const char*)&wget_wch_back, 1));
VALUE r = rb_assoc_new (INT2NUM(retcode), LONG2NUM(wget_wch_back));
return r;
}

Expand Down

0 comments on commit 4481f31

Please sign in to comment.