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 回答