updated Curses::Window example
The example on http://ruby-doc.org/stdlib-2.0/libdoc/curses/rdoc/Curses/Window.html produces somewhat garbled output. Subwindow can be used to avoid that:
my_str = "LOOK! PONIES!"
bwin = Curses::Window.new( 10, (my_str.length + 10),
(Curses.lines - 10) / 2,
(Curses.cols - (my_str.length + 10)) / 2 )
win = bwin.subwin( 6, my_str.length + 6,
(Curses.lines - 6) / 2,
(Curses.cols - (my_str.length + 6)) / 2 )
win << "\nORLY"
win << "\nYES!! " + my_str
Updated by zzak (Zachary Scott) almost 7 years ago
- Status changed from Open to Closed
- % Done changed from 0 to 100
This issue was solved with changeset r40506.
Michal, thank you for reporting this issue.
Your contribution to Ruby is greatly appreciated.
May Ruby be with you.
- ext/curses/curses.c: Update Curses::Window example for nicer output Patch by Michal Suchanek [Bug #8121] [ruby-core:53520]