Where's the Ncurses Cursor?

Post your Gambas programming questions here.
Post Reply
User avatar
stevedee
Posts: 518
Joined: Monday 20th March 2017 6:06pm

Where's the Ncurses Cursor?

Post by stevedee »

I'm just curious (so don't waste any time, unless you too are curious) about how to display a cursor on an gb.Ncurses window.

A simple program like this:-
Public Sub Main()

  With Window
    .Border = Border.ACS        
    .CursorX = 1 + index
    .CursorY = 1 + index
    .Print("cursor x,y: " & .CursorX & ", " & .CursorY)
  End With
  Screen.Cursor = Cursor.VeryVisible
 
End
...proves that the cursor is moving, but there is no sign of the actual cursor.

Remembering that there may be a problem with 'lite' terminals, I also tested on xterm.

Thinking that the cursor may dissapear when the program completes, I tried again with this code:-
Public Sub Main()
Dim index As Integer

  For index = 0 To 10
    With Window
      .Border = Border.ACS        
      .CursorX = 1 + index
      .CursorY = 1 + index
      .Print("cursor x,y: " & .CursorX & ", " & .CursorY)
    End With
    Screen.Cursor = Cursor.VeryVisible
    Wait 1
  Next
End
...still no cursor within my window.

EDIT: I think the problem is that "Screen.Cursor" does not refer to the Ncurses cursor. I need to use Cursor in gb.ncurses.
User avatar
sjsepan
Posts: 68
Joined: Saturday 12th October 2019 10:11pm
Location: Leeper, PA, USA
Contact:

Re: Where's the Ncurses Cursor?

Post by sjsepan »

tried this also
cursor only appears on upper-left border corner
with Ask() i can see my input echoed there, but the PrintCenter() goes in the center (if i type one of the 'abc').
' Gambas module file

Public Sub Main()

    Dim sResponse As String
    Dim index As Integer

    ' With Window
    Screen.Cursor = Cursor.VeryVisible
    Screen.Resize(25, 80)
    Window.Border = Border.ACS
    For index = 0 To 3
        ' Window.Border = Border.ACS
        Window.CursorX = 1 + index
        Window.CursorY = 1 + index
        Window.Print("cursor x,y: " & Window.CursorX & ", " & Window.CursorY)
        ' Screen.Cursor = Cursor.VeryVisible
        Wait 0.1
    Next
    Window.Locate(Window.CursorX, Window.CursorY)
    sResponse = Window.Ask("ABC", 2)
    Window.PrintCenter(sResponse)
    ' End With

End
User avatar
sjsepan
Posts: 68
Joined: Saturday 12th October 2019 10:11pm
Location: Leeper, PA, USA
Contact:

Re: Where's the Ncurses Cursor?

Post by sjsepan »

OK, I also ran across the topic on your blog.
http://captainbodgit.blogspot.com/2017/ ... -text.html
Its from a week later, so I'll have to see what else you came up with in that time...
Steve
Post Reply