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

search for in the

newt_grid_add_components_to_form> <newt_form
[edit] Last updated: Fri, 25 May 2012

view this page in

newt_get_screen_size

(PECL newt >= 0.1)

newt_get_screen_size 参照で渡された引数に、現在の端末の大きさを格納する

説明

void newt_get_screen_size ( int &$cols , int &$rows )

参照で渡された引数に、現在の端末の大きさを格納します。

パラメータ

cols

端末のカラム数。

rows

端末の行数。

返り値

値を返しません。

例1 newt_get_screen_size() の例

このコードは、端末の画面の大きさを表示します。

<?php
 newt_init
();
 
newt_get_screen_size (&$cols, &$rows);
 
newt_finished();

 print 
"端末のサイズは {$cols}x{$rows} です。\n";
?>

上の例の出力は以下となります。

端末のサイズは 138x47 です。



add a note add a note User Contributed Notes newt_get_screen_size
frxstrem 28-Jul-2010 02:57
Note that this function **requires** you to manually pass by reference:

<?php

newt_init
();

newt_get_screen_size($cols, $rows); // This won't work
# PHP Notice:  Undefined variable: cols in [file] on line 5
# PHP Notice:  Undefined variable: rows in [file] on line 5

newt_get_screen_size(&$cols, &$rows); // This, however, works fine

newt_finished();

?>

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