1

ruby curses のわずかなドキュメントで、このメソッドを見つけました

A_BLINK
Blinking

See ::attrset

しかし、私はそれを利用する方法がわかりません。

win1 = Window.new
win1.addstr.a_blink "Blinking" #=> error

私を責めないでください。呪いに関してグーグルには文字通り何の助けもありません。正直なところ、少なくともルビーではありません。

4

1 に答える 1

2

で属性を設定できますCurses::Window#attrset。次に例を示します。

require "curses"
include Curses

init_screen
begin
  attrs = {
    A_NORMAL =>     'Normal display (no highlight)',
    A_STANDOUT =>   'Best highlighting mode of the terminal.',
    A_UNDERLINE =>  'Underlining',
    A_REVERSE =>    'Reverse video',
    A_BLINK =>      'Blinking',
    A_DIM =>        'Half bright',
    A_BOLD =>       'Extra bright or bold',
    A_PROTECT =>    'Protected mode',
    A_INVIS =>      'Invisible or blank mode',
    A_ALTCHARSET => 'Alternate character set',
  }
  attrs.each { |a, s|
    attrset(a)
    addstr("#{s}\n")
  }
  refresh
  getch
ensure
  close_screen
end
于 2013-10-12T22:38:31.217 に答える