php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28426 ncurses_mvwaddstr() doesn't add text into correct window
Submitted: 2004-05-18 00:14 UTC Modified: 2005-03-06 19:58 UTC
From: andrewdk at comcast dot net Assigned: hholzgra (profile)
Status: Not a bug Package: ncurses related
PHP Version: 5.0.0RC2 OS: Gentoo Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: andrewdk at comcast dot net
New email:
PHP Version: OS:

 

 [2004-05-18 00:14 UTC] andrewdk at comcast dot net
Description:
------------
Using PHP CLI 5.0.0RC2
Ncurses 5.4
--with-ncurses

When using ncurses_mvwaddstr(), the text to be added does not appear in the ncurses window specified, but appears in the top-left corner of the terminal window. Neither of the y,x coordinates change where the text goes.
This source example is derived from the Zend ncurses tutorial. 

Reproduce code:
---------------
<?php
	define("ESCAPE_KEY",27);
	$ncurse = ncurses_init();
	$small = ncurses_newwin(10,30,7,25);
	while(1){
	ncurses_wborder($small,0,0, 0,0, 0,0, 0,0);
	ncurses_wrefresh($small);
	$pressed = ncurses_getch();
	If($pressed == ESCAPE_KEY){
			ncurses_end();
			exit;
		}else{
			ncurses_mvwaddstr($small,2,2,$pressed);
		}
	}
?>

Expected result:
----------------
This is expected to add the character number to the "$small" window at coordinates 2,2; and exit when ESC is pressed. 

Actual result:
--------------
The charatcer is not inserted into the "$small" window at coords 2,2; but onto the terminal at 0,0.
ESC works as expected (however there is a half-second delay from pressing it to the program exiting.)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2005-03-06 19:58 UTC] sniper@php.net
It's just bug in your script. (and propably bug in the ncurses tutorial you got it from)
 
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 01:01:31 2024 UTC