闪烁字符串在Ruby的微薄文档诅咒我发现这个方法在诅咒应用
A_BLINK
Blinking
See ::attrset
不过,我不知道如何利用它。
win1 = Window.new
win1.addstr.a_blink "Blinking" #=> error
请不要怪我,关于诅咒在谷歌上几乎没有任何帮助。说实话,至少不用于红宝石。
闪烁字符串在Ruby的微薄文档诅咒我发现这个方法在诅咒应用
A_BLINK
Blinking
See ::attrset
不过,我不知道如何利用它。
win1 = Window.new
win1.addstr.a_blink "Blinking" #=> error
请不要怪我,关于诅咒在谷歌上几乎没有任何帮助。说实话,至少不用于红宝石。
您可以使用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
Ruby的'Curses'类只是一个包装。你可以阅读这里的概念:http://tldp.org/HOWTO/NCURSES-Programming-HOWTO/ – Stefan