[Gambas-user] ncurses, question

KKing kicking177 at gmail.com
Mon Jan 4 09:36:57 CET 2021


> Is there some way with ncurses to issue the endwin within my program after I am done with a window and screen screen object.
> I see that the gb.ncurses main does an init and end..... but.....

I'm not saying this is the right way to do but in my ncurses programs 
I've done the following

within main program
....
Dim mWarning As MWarning
strMessage = "This is a popup warning"
mWarning = New MWarning
mWarning.Main(strMessage)
....

and a module for each ncurses Window I temporarily use e.g.

' Gambas module file
Private $hWarning As Window


Public Sub Main(strMessage As String, Optional colValue As Integer) As 
String

   Dim intInput As Integer
   Dim strReturn As String

   strReturn = ""

   $hWarning = New Window(False, 0, 0, 120, 40) As "WarningScreen"

   $hWarning.Background = Color.Red

   If (colValue <> Null) Then
     Try $hWarning.Background = colValue
   Endif

   $hWarning.Print(strMessage, 1, 10,, Main.iColPairInput)
   $hWarning.Print(" Press any key to Continue ", 2, 14,, 
Main.iColPairInput)
   intInput = $hWarning.Read()

   $hWarning = Null
   Return strReturn
End



More information about the User mailing list