summaryrefslogtreecommitdiff
path: root/ext/curses
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-08 23:12:32 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2005-02-08 23:12:32 +0000
commit35cdf6dd40ab7e971a8ab841883a60bc59fbaa38 (patch)
treeb0f0f91e0444acf548b5c4c79f62a07361fbf069 /ext/curses
parent2879018f4d95ea623fe9b10517565f1b56740426 (diff)
* ext/curses/curses.c (window_color_set): [ruby-core:04393]
* ext/socket/socket.c (Init_socket): SO_REUSEPORT added. [ruby-talk:130092] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_8@7925 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/curses')
-rw-r--r--ext/curses/curses.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c
index a8952bf..d003f1d 100644
--- a/ext/curses/curses.c
+++ b/ext/curses/curses.c
@@ -1195,6 +1195,20 @@ window_setscrreg(VALUE obj, VALUE top, VALUE bottom)
#endif
}
+#ifdef USE_COLOR
+static VALUE
+window_color_set(VALUE obj, VALUE col)
+{
+ struct windata *winp;
+ int res;
+
+ GetWINDOW(obj, winp);
+ res = wcolor_set(winp->window, NUM2INT(col), NULL);
+ return (res == OK) ? Qtrue : Qfalse;
+ return Qfalse;
+}
+#endif /* USE_COLOR */
+
static VALUE
window_scroll(VALUE obj)
{
@@ -1471,6 +1485,9 @@ Init_curses()
rb_define_method(cWindow, "box", window_box, -1);
rb_define_method(cWindow, "move", window_move, 2);
rb_define_method(cWindow, "setpos", window_setpos, 2);
+#ifdef USE_COLOR
+ rb_define_method(cWindow, "color_set", window_color_set, 1);
+#endif /* USE_COLOR */
rb_define_method(cWindow, "cury", window_cury, 0);
rb_define_method(cWindow, "curx", window_curx, 0);
rb_define_method(cWindow, "maxy", window_maxy, 0);