downloads | documentation | faq | getting help | mailing lists | licenses | wiki | reporting bugs | php.net sites | conferences | my php.net

search for in the

ncurses_termattrs> <ncurses_standout
[edit] Last updated: Fri, 24 May 2013

view this page in

ncurses_start_color

(PHP 4 >= 4.0.7, PHP 5 < 5.3.0, PECL ncurses >= 1.0.0)

ncurses_start_color色機能を初期化する

説明

int ncurses_start_color ( void )

ncurses の色機能を初期化します。この関数は、 ncurses_init() をコールした後で その他の色操作関数をコールする前に実行する必要があります。 ncurses_init() の直後に実行するのがよいでしょう。

パラメータ

この関数にはパラメータはありません。

返り値

成功した場合に 0、 色テーブルの割り当てに失敗した場合や ncurses が初期化されていない場合に -1 を返します。

例1 指定した色で文字列を画面に書き込む

<?php
ncurses_init
();

// 端末が色をサポートしている場合に、初期化してアクティブな色を設定します
if (ncurses_has_colors()) {
    
ncurses_start_color();
    
ncurses_init_pair(1NCURSES_COLOR_YELLOWNCURSES_COLOR_BLUE);
    
ncurses_color_set(1);
}

// 指定した位置に文字列を書き込みます
ncurses_mvaddstr(1010"Hello world! Yellow on blue text!");

// 出力をフラッシュします
ncurses_refresh();

ncurses_end();
?>

参考



add a note add a note User Contributed Notes ncurses_start_color - [0 notes]
There are no user contributed notes for this page.

 
show source | credits | sitemap | contact | advertising | mirror sites