Skip to content

Instantly share code, notes, and snippets.

@Yamabiko
Last active December 19, 2015 03:39
Show Gist options
  • Save Yamabiko/5891443 to your computer and use it in GitHub Desktop.
Save Yamabiko/5891443 to your computer and use it in GitHub Desktop.
# -*- 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