Last active
December 19, 2015 03:39
-
-
Save Yamabiko/5891443 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- coding: utf-8 -*- | |
require "curses" | |
Curses.init_screen | |
Curses.start_color | |
Curses.init_pair(1, Curses::COLOR_BLACK, Curses::COLOR_WHITE) | |
Curses.init_pair(2, Curses::COLOR_WHITE, Curses::COLOR_GREEN) | |
win = Curses.stdscr.subwin(5,30,3,10) | |
# subwin(window行数,window列数,行位置,列位置) | |
win.attrset(Curses.color_pair(1)) | |
# winに対してcolor_pairを指定 | |
win.box(?|,?-,?+) | |
win.setpos(2,5) | |
win.attrset(Curses.color_pair(2)) | |
win.addstr("sub window") | |
win.refresh | |
# winをrefresh | |
Curses.getch | |
Curses.close_screen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment