public function getPanel() { if (!$this->panel) { $this->panel = ncurses_new_panel($this->getWindow()); } return $this->panel; }
public function __construct($rows = 0, $cols = 0, $y = 0, $x = 0) { parent::__construct($rows, $cols, $y, $x); $this->panel = ncurses_new_panel($this->getWindow()); $rows = $this->getMaxY(); $cols = $this->getMaxX(); $this->addText(["R: {$rows}, C:{$cols}", "x:{$x}, y: {$y}"]); }
for ($i = 0; $i < $n_lines; $i++) { $window_width = max($window_width, strlen($lines[$i])); } $window_width += 4; $x_coords = array(10, 14, 18); $y_coords = array(10, 12, 8); for ($i = 0; $i < 3; $i++) { $windows[$i] = ncurses_newwin(4 + $n_lines, $window_width, $y_coords[$i], $x_coords[$i]); ncurses_wborder($windows[$i], 0, 0, 0, 0, 0, 0, 0, 0); ncurses_wattron($windows[$i], NCURSES_A_REVERSE); ncurses_mvwaddstr($windows[$i], 0, 2, ' window #' . $i . ' '); ncurses_wattroff($windows[$i], NCURSES_A_REVERSE); for ($j = 0; $j < $n_lines; $j++) { ncurses_mvwaddstr($windows[$i], 2 + $j, 2, $lines[$j]); } ncurses_wrefresh($windows[$i]); $panels[$i] = ncurses_new_panel($windows[$i]); } ncurses_update_panels(); ncurses_curs_set(0); ncurses_noecho(); $i = 0; $k = NULL; while (XCURSES_KEY_ESC != $k) { $k = ncurses_getch(); ncurses_top_panel($panels[$i % 3]); ncurses_update_panels(); ncurses_doupdate(); $i++; } ncurses_end();
/** * Constructor * @param Window A window to associate */ public function __construct(Window $window) { $this->window = $window; $this->panelResource = ncurses_new_panel($window->getWindow()); $this->_debug($this->window, $this->panelResource); }