Deprecated: The each() function is deprecated. This message will be suppressed on further calls in /home/zhenxiangba/zhenxiangba.com/public_html/phproxy-improved-master/index.php on line 456
PHP: ncurses_wrefresh - Manual
[go: Go Back, main page]

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

search for in the

ncurses_wstandend" width="11" height="7"/> <ncurses_wnoutrefresh
Last updated: Wed, 01 Nov 2006
view this page in

ncurses_wrefresh

(PHP 4 >= 4.2.0, PHP 5)

ncurses_wrefresh -- 端末画面のウインドウをリフレッシュする

説明

int ncurses_wrefresh ( resource window )

警告

この関数は、 実験的 なものです。この関数の動作・ 名前・その他ドキュメントに書かれている事項は、予告なく、将来的な PHP のリリースにおいて変更される可能性があります。 この関数は自己責任で使用してください。

警告

この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。



add a note add a note User Contributed Notes
ncurses_wrefresh
php at kormoc dot com
29-Nov-2005 02:08
Keep in mind, you need to do a ncurses_refresh before any window drawing options to display the window correctly.

for example
ncurses_wclear($window);
ncurses_wborder($window, 0, 0, 0, 0, 0, 0, 0, 0);
ncurses_wrefresh($window);

won't work correctly the first time though the loop (not sure why),

but throw on a ncruses_refresh at the top and it displays correctly
joeldegan AT yahoo.com
16-Dec-2002 05:24
Here is a functional example of drawing dynamic windows and refreshing them using ncurses_wrefresh.

This draws the main window, borders it, creates a small window borders it, creates a lower window and borders it as well. it also shows an example of doing a little backgrounding..

<?php
/*
the window will look somewhat like this...
+--------------------------------------+
|+---+                                  |
||  |                                  |
|+---+                                |
|                                        |
|+------------------------------------+|
||                                      ||
|+------------------------------------+|
+--------------------------------------+
*/

$n=0;
$a = ncurses_init();
ncurses_border(0,0, 0,0, 0,0, 0,0);
$z = ncurses_newwin ( 15, 15, 10, 10);

if(
ncurses_has_colors()){
  
ncurses_start_color();
      
ncurses_init_pair(1,NCURSES_COLOR_RED,NCURSES_COLOR_BLACK);
      
ncurses_init_pair(2,NCURSES_COLOR_BLUE,NCURSES_COLOR_BLACK);
      
ncurses_init_pair(3,NCURSES_COLOR_YELLOW,NCURSES_COLOR_BLACK);
      
ncurses_init_pair(4,NCURSES_COLOR_BLUE,NCURSES_COLOR_BLACK);
      
ncurses_init_pair(5,NCURSES_COLOR_MAGENTA,NCURSES_COLOR_BLACK);
      
ncurses_init_pair(6,NCURSES_COLOR_CYAN,NCURSES_COLOR_BLACK);
      
ncurses_init_pair(7,NCURSES_COLOR_WHITE,NCURSES_COLOR_BLACK);
}
//fi

while(1){
  for (
$x=1; $x<80; $x++) {
   for (
$y=1; $y<24; $y++) {
        
$n++;
        
ncurses_move($y,$x);
        
ncurses_addch($n+64);
        
ncurses_color_set($n%8);
         if(
$n>26)$n=0;
   }
//rof
 
}//rof

// border the main window
ncurses_border(0,0, 0,0, 0,0, 0,0);
ncurses_refresh();

// create a new little window and border it.
$z = ncurses_newwin ( 10, 10, 2, 2);
ncurses_wborder($z,0,0, 0,0, 0,0, 0,0); // undocumented function, border the window
ncurses_wrefresh($z); // show it

// get our maximum y and x values
$current = getmaxxy();
$lines = $current[1];
$cols = $current[0];

// create a lower window which is dynamically sized...
$c = ncurses_newwin (10, $cols-4, $lines-11, 2);
ncurses_wborder($c,0,0, 0,0, 0,0, 0,0); // border it
ncurses_wrefresh($c); // show it
ncurses_getch(); // wait for user to press key
ncurses_clear();// clear and then redraw..

}//wend

function getmaxxy(){
  
$rez = `/usr/X11R6/bin/resize`;
  
$rez = explode("\n",$rez);
   while(list(
$key,$val)=each($rez)){
      
$a=explode("=",$val);
       if(
trim($a[0])=="COLUMNS"){ $COLUMNS = $a[1]; }
       if(
trim($a[0])=="LINES"){ $LINES = $a[1]; }
   }
//
  
$retval[0]=$COLUMNS;
  
$retval[1]=$LINES;
   return
$retval;
}

?>

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