PHP ncurses窗口

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了PHP ncurses窗口相关的知识,希望对你有一定的参考价值。

  1. #!/usr/bin/env php
  2. <?php
  3.  
  4. // we begin by initializing ncurses
  5. $ncurse = ncurses_init();
  6.  
  7. // let ncurses know we wish to use the whole screen
  8. $fullscreen = ncurses_newwin(0, 0, 0, 0);
  9.  
  10. // draw a border around the whole thing.
  11. ncurses_border(0,0, 0,0, 0,0, 0,0);
  12.  
  13. // now lets create a small window
  14. $small = ncurses_newwin(10, 30, 7, 25);
  15.  
  16. // border our small window.
  17. ncurses_wborder($small,0,0, 0,0, 0,0, 0,0);
  18.  
  19. ncurses_refresh();// paint both windows
  20.  
  21. // move into the small window and write a string
  22. ncurses_mvwaddstr($small, 5, 5, " Test String ");
  23.  
  24. // show our handiwork and refresh our small window
  25. ncurses_wrefresh($small);
  26.  
  27. $pressed = ncurses_getch();// wait for a user keypress
  28.  
  29. ncurses_end();// clean up our screen
  30.  
  31. ?>

以上是关于PHP ncurses窗口的主要内容,如果未能解决你的问题,请参考以下文章

两个 ncurses 窗口并行运行

为啥这个文本没有被 ncurses 着色?

NCurses – getstr() 和功能键

C指针原理(29)-Ncurses-文本终端的图形

是否可以让 NCurses CDK 矩阵动态调整到终端窗口的大小?

C指针原理(35)-Ncurses-文本终端的图形