ID:               24092
 Updated by:       [EMAIL PROTECTED]
 Reported By:      garrote at dm dot com dot br
-Status:           Open
+Status:           Bogus
 Bug Type:         Unknown/Other Function
 Operating System: linux 2.4.20
 PHP Version:      4CVS-2003-06-09 (stable)
 New Comment:

Fatal error: Call to undefined function:  ncurses_wbkgdset() 

Try provide a script that has even remote possibility on
working..or at least a GDB backtrace.



Previous Comments:
------------------------------------------------------------------------

[2003-06-09 07:33:07] garrote at dm dot com dot br

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]


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=24092&edit=1

Reply via email to