|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2003-06-09 08:41 UTC] sniper@php.net
[2003-06-09 09:15 UTC] garrote at dm dot com dot br
[2003-06-09 22:05 UTC] sniper@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Fri Oct 24 10:00:01 2025 UTC |
Good morning, there is a problem with ncurses_panel_window. if you create more than one panel it doesn?t sets the recurse correctly and return segment fault. i have to use array to storage the information of window and panel. one think...we use function to retrieve the information...but i don?t think that it?s the problem. function nova_janela($nr_linhas, $nr_colunas, $linha, $coluna, $cor) { global $WINDOW; $win = ncurses_newwin($nr_linhas, $nr_colunas, $linha, $coluna); if(!$win) // temos uma window return false; $janela = ncurses_new_panel($win); if(!$janela) // temos uma janela return false; $WINDOW["$janela"] = $win; // coloca na memoria o recurso if(ncurses_has_colors() and $cor) { // temos cor no terminal $fg = ($cor == NCURSES_COLOR_BLUE) ? NCURSES_COLOR_WHITE : NCURSES_COLOR_BLACK; $bg = $cor; ncurses_init_pair($cor, $fg, $bg); ncurses_wattron($win, (color_pair($cor) | ' ')); } else ncurses_wbkgdsett($win, NCURSES_A_BOLD | ' '); ncurses_wborder($win, 0,0,0,0,0,0,0,0); $l = 1; while($l < $nr_linhas - 1) { $c = 1; ncurses_wmove($win, $l, 1); while($c++ < $nr_colunas - 1) { ncurses_waddch($win, 32); //ncurses_update_panels(); //oops ncurses_wrefresh($win); //oops } $l++; } ncurses_update_panels(); ncurses_doupdate(); return $janela; } function remove_janela($janela) { global $WINDOW; if(!$janela) // temos uma janela return false; //$win = ncurses_panel_window($janela); // error Segment fault $win = $WINDOW["$janela"]; // recupera recurso if(!$win) // temos uma window return false; ncurses_del_panel($janela); // libera janela ncurses_delwin($win); // libera window ncurses_update_panels(); ncurses_doupdate(); return true; } $WINDOW=ARRAY(); ncurses_init(); if(ncurses_has_colors()) ncurses_start_color(); $i=0; while($i < 5) { $a[$i] = nova_janela(10 + ($i * 2), 20 + ($i * 5), 10 + $i, 10 + $i,$i + 1); $i++; } $i=0; while($i < 5) { remove_janela($a[$i]); $i++; } ncurses_end(); exit; PHP 4.3.3-dev (cgi) (built: Jun 6 2003 19:30:49) Copyright (c) 1997-2003 The PHP Group Zend Engine v1.3.0, Copyright (c) 1998-2003 Zend Technologies [PHP Modules] ctype mysql ncurses overload pcre posix session standard tokenizer xml [Zend Modules]