Gambas command line TUI app

Post

Posted
Rating:
#1 (In Topic #1068)
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 Hi everyone,

Does anyone have any examples of making an TUI app on the command line?

Also would a Gambas command line app run without xserver?
Online now: No Back to the top

Post

Posted
Rating:
#2
Guru
BruceSteers is in the usergroup ‘Guru’

AndyGable said

Hi everyone,

Does anyone have any examples of making an TUI app on the command line?

Also would a Gambas command line app run without xserver?

what's a TUI app ?

yes it runs with no xserver but of course you cannot use gb.gui or any gui related components
Online now: No Back to the top

Post

Posted
Rating:
#3
Enthusiast
AndyGable is in the usergroup ‘Enthusiast’
 Sorry TUI stand for Text user interface

Am I still able to use the things like list boxes etc in the command app or do I need to use the Linux native methods?
Online now: No Back to the top

Post

Posted
Rating:
#4
Avatar
Regular
Technopeasant is in the usergroup ‘Regular’
ncurses is available. I just released a game using it.

https://forum.gambas.one/viewtopic.php?t=820
https://forum.gambas.one/viewtopic.php?p=7298

You do not get to use a form designer though, so will have to do it in markup.
Online now: No Back to the top

Post

Posted
Rating:
#5
Guru
BruceSteers is in the usergroup ‘Guru’

AndyGable said

Sorry TUI stand for Text user interface

Am I still able to use the things like list boxes etc in the command app or do I need to use the Linux native methods?

nope. unless you're running a gui system like x11 or wayland.

a listbox is a graphical GUI object part of gb.gui and a Terminal does not work like that. a terminal only has text output

there are methods. like technopeasant says there is ncurses

there's also the unfinished gb.term.form component that was supposed to provide a gui like experience in a terminal.
Online now: No Back to the top

Post

Posted
Rating:
#6
Avatar
Regular
Technopeasant is in the usergroup ‘Regular’
Are you aware of any example code for gb.term.form or is it not even that complete?
Online now: No Back to the top

Post

Posted
Rating:
#7
Guru
BruceSteers is in the usergroup ‘Guru’

Technopeasant said

Are you aware of any example code for gb.term.form or is it not even that complete?

not that works.
there some test classes in the component but they don't seem to function.

Maybe the source code can reveal some clues on how it works.

Looks to me like it was created some time ago and needs updating as the root classes like TermControl.class throw a lot of errors out.


I think if you can figure out how to get xterm escape sequences properly then it's just a case of monitoring mouse position and clicks.
here's info on all the escape sequences (the mouse tracking relevant ones)
https://invisible-island.net/xterm/ctlseqs/ctlseqs.html#h2-Mouse-Tracking
Online now: No Back to the top

Post

Posted
Rating:
#8
Guru
BruceSteers is in the usergroup ‘Guru’
if you open a terminal you can type the following…

# enable mouse button tracking…
echo -e "\e[?7;1002h"

# enable SGR mode if you want more easily readable codes.
echo -e "\e[?7;1006h"


now mouse click some terminal area and see the data.

I'm not sure how to process the data.  (gb.form.terminal probably has code that processes escape sequences though so maybe study that)

Should give you something to play with :)

EDIT:
I just realized i may have slid off track here still stuck thinking about mouse clicking GUI's  
i guess a proper "TUI" would work on keypress events not mouse.  :-/
Online now: No Back to the top

Post

Posted
Rating:
#9
Avatar
Regular
Technopeasant is in the usergroup ‘Regular’
As I understand it, mouse and keyboard are acceptable in a TUI, though probably best that it can all be done with only a keyboard if necessary.
Online now: No Back to the top
1 guest and 0 members have just viewed this.