diff options
author | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-27 23:30:11 +0000 |
---|---|---|
committer | zzak <zzak@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2013-04-27 23:30:11 +0000 |
commit | 7e70b8ac52a8f4939d65cab96a005187a637d9ed (patch) | |
tree | 3a2c0fe0318d50347e3f3847009bb5fe7a499550 /ext/curses/curses.c | |
parent | e781aeef96667db678b9e852349a7f01bf6f9ff2 (diff) | |
download | ruby-7e70b8ac52a8f4939d65cab96a005187a637d9ed.tar.gz |
* ext/curses/curses.c: Update Curses::Window example for nicer output
Patch by Michal Suchanek [Bug #8121] [ruby-core:53520]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40506 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext/curses/curses.c')
-rw-r--r-- | ext/curses/curses.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/ext/curses/curses.c b/ext/curses/curses.c index 88b1bdb3aa..e9b385c7fe 100644 --- a/ext/curses/curses.c +++ b/ext/curses/curses.c @@ -2814,10 +2814,14 @@ Init_curses(void) * Curses.init_screen() * * my_str = "LOOK! PONIES!" - * win = Curses::Window.new( 8, (my_str.length + 10), - * (Curses.lines - 8) / 2, + * bwin = Curses::Window.new( 10, (my_str.length + 10), + * (Curses.lines - 10) / 2, * (Curses.cols - (my_str.length + 10)) / 2 ) - * win.box("|", "-") + * bwin.box("\\", "/") + * bwin.refresh + * win = bwin.subwin( 6, my_str.length + 6, + * (Curses.lines - 6) / 2, + * (Curses.cols - (my_str.length + 6)) / 2 ) * win.setpos(2,3) * win.addstr(my_str) * # or even |