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

search for in the

ncurses_has_ic> <ncurses_halfdelay
[edit] Last updated: Fri, 25 May 2012

view this page in

ncurses_has_colors

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

ncurses_has_colorsカラー端末かどうか確認する

説明

bool ncurses_has_colors ( void )

端末がカラー表示機能を持つかどうかを調べます。 この関数を使用すると、端末に依存しないプログラムを書くことができます。 この関数をコールする前に、 ncurses_init() で ncurses を初期化しておく必要があります。

パラメータ

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

返り値

端末がカラー表示機能を持っている場合に TRUE、持っていない場合に FALSE を返します。

例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_has_colors
There are no user contributed notes for this page.

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