bug-ncurses
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with initscr() in ncurses.h


From: Thomas Dickey
Subject: Re: Problem with initscr() in ncurses.h
Date: Fri, 1 Dec 2023 19:00:38 -0500

On Fri, Dec 01, 2023 at 01:43:59PM -0600, Wade Miller wrote:
> I have used Perl for 30+ years, but never (n)curses.  I am now trying to
> write a data editing routine for my church. The data editing part works,
> but I need to use the move() command.  However I cannot get initscr() to
> initialize the window.
> Attached is a snippet of the program showing my attempt to initialize
> {initscr()} the window.  I get the following error and simply have not
> found a way to correct it.
> 
> error: Undefined subroutine &main::initscr called at ./shorty.pl line 8.
> Your help would be gratefully appreciated.
> 
> Attached are a few lines of the program which give the error.
> Using LIBNCURSES6_6.3-2 on ubuntu 20.04.
> 
> Thank you
> Wade Miller
> (IT Retiree)

Usually people use the curses wrapper (which calls initscr along with
other stuff), but here's a simple example that explicitly uses initscr:

import curses
stdscr = curses.initscr()
curses.noecho()
curses.cbreak()
stdscr.keypad(1)

stdscr.addstr("Hello World!\n")
stdscr.getch()

curses.nocbreak(); stdscr.keypad(0); curses.echo()
curses.endwin()



-- 
Thomas E. Dickey <dickey@invisible-island.net>
https://invisible-island.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]