Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

print from curses

by morgon (Priest)
on Feb 01, 2017 at 00:36 UTC ( [id://1180729]=perlquestion: print w/replies, xml ) Need Help??

morgon has asked for the wisdom of the Perl Monks concerning the following question:

Hi,

is it possible to print from a curses-program in such a way that the output is retained after the script ends?

To illustrate:

use Curses::UI; my $cui = new Curses::UI; my $win = $cui->add('window_id', 'Window'); my $listbox = $win->add( 'mylistbox', 'Listbox', -values => [1, 2, 3], -labels => { 1 => 'One', 2 => 'Two', 3 => 'Three' }, ); $listbox->onChange( sub { my $sel = $listbox->get; endwin; print $sel; exit; } ); $cui->set_binding( sub { exit(0); } , "\cC"); $cui->mainloop;
So my thinking was that calling endwin in the handler would end all the curses-magic and you could print stuff that curses would no longer overwrite, but unfortunately that does not work.

Does anyone know how to do this (I am a complete newbie with curses I am afraid).

Many thanks!

Replies are listed 'Best First'.
Re: print from curses
by Anonymous Monk on Feb 01, 2017 at 02:44 UTC
      clear_on_exit is documented (I don't know why you grep through the source) and it should be off by default.

      . I have already tried to turn it off explicitly but it does not help with my problem.

      should have mentioned that in my question, Sorry.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://1180729]
Approved by beech
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others examining the Monastery: (6)
As of 2024-04-23 22:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found