My perl program needs to jump between ncurses and a raw console as it executes a system call in a loop, like this (simplified for problem emphasis):
- init Cdk
- present menu
- deinit Cdk
- run system call
Unfortunately Cdk appears to initialize ncurses at the use Cdk
import and not instantiation
(Cdk::init()
) and so I don't know how to disable it. This behavior seems completely absurd to me; apart from the loop described above, my program also has a special mode where a database is initialized - this part does not present any kind of menu (only raw console output) yet it would seem that I now have to format all my output with menus - whilst not even using a menu! And again, just to print the program help output now seems to require me to generate a Cdk widget - insane.
Is there a way to easily jump in and out of ncurses when using Cdk or am I screwed?
Some example code:
#!/usr/bin/perl
use Cdk;
eval {popupLabel(["popup before init"]);}; # will fail as init() isn't called
print "Test after use\n"; # won't be printed (which is a problem!)
Cdk::init();
print "Test after init\n"; # won't be printed
popupLabel(["popup after init"]);
Cdk::end();
print "Test after end\n"; # won't be printed