[Gambas-user] ncurses, question

Tobias Boege taboege at gmail.com
Wed Jan 6 22:25:05 CET 2021


On Wed, 06 Jan 2021, Benoît Minisini wrote:
> Le 06/01/2021 à 13:52, Tobias Boege a écrit :
> > On Mon, 04 Jan 2021, Brian G wrote:
> > > Tobias,
> > > 
> > > When I run your program in a terminal
> > > it hangs in the ncurses mode no input unless I add
> > > an explicit quit instruction.
> > > 
> > > quit 0
> > > 
> > > if i just add a screen.suspend()
> > > it goes back to terminal but never exits
> > > 
> > 
> > Isn't this normal? Do you have an old ncurses project which behaves
> > differently since that commit? I have an older 3.14.90 here where a
> > gb.ncurses application also doesn't terminate on its own.
> > 
> > This is because gb.ncurses watches the input file descriptor for
> > keystrokes, keeping the Gambas process running in the event loop,
> > for as long as there is a valid Window object. (This is the same
> > as with gb.qt4, superficially.) And there is always a default,
> > static Window object representing the whole screen.
> > 
> > The project I sent you should print, step out of and into ncurses
> > mode and print again, all on its own. When it says "Bye bye", you
> > can ctrl+c it.
> > 
> > Best,
> > Tobias
> > 
> 
> Shouldn't the user be able to close the default static window to terminate
> the application?
> 

Closing is currently bound to the window's reference count. You can close it
by assigning Null to every variable holding the window object. To implement
a Close method, I would need to know how to mark an object as invalid using
the interpreter APIs after I destroyed its contents, even if other parts of
the program still hold a reference to the window. Can you tell me?

Best,
Tobias

-- 
"There's an old saying: Don't change anything... ever!" -- Mr. Monk


More information about the User mailing list