Turbo Vision Library for Free Basic

External libraries (GTK, GSL, SDL, Allegro, OpenGL, etc) questions.
Post Reply
demosthenesk
Posts: 140
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Turbo Vision Library for Free Basic

Post by demosthenesk »

What is Turbo Vision ?
A modern port of Turbo Vision 2.0, the classical framework for text-based user interfaces. Now cross-platform and with Unicode support.
Image

Well i downloaded tvision from https://github.com/magiblot/tvision
i compiled the source with cmake and i have a libtvision.a file copied to FB lib/linux-x86_64 directory.
Now...where i have to look for instruction to create an tvision.bi file for FB ?
Should i create a c++ wrapper ?
How can i do this ?
Thanks for any help...!
:?:
marcov
Posts: 3392
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Turbo Vision Library for Free Basic

Post by marcov »

I still have a soft spot for TV/FV. I believe ours is not entirely 2.0, and some parts like the color select dialog are missing. Some work was last winter to get better unicode support, but I haven't tested it yet. I particularly worked on the help system

A picture of ours with the CHM help system popped up:
Image

Does your version also have an help system?
demosthenesk
Posts: 140
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Turbo Vision Library for Free Basic

Post by demosthenesk »

The version i found is only Turbo Vision for c++.
No fpc ide or any help system.

i have installed the 3.2.2 version of Free Pascal with Free Vision and with help chm files separately.
Image
demosthenesk
Posts: 140
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Turbo Vision Library for Free Basic

Post by demosthenesk »

There are some alternatives TUIs to Turbo Vision.
https://en.wikipedia.org/wiki/Category: ... _libraries

The Newt https://en.wikipedia.org/wiki/Newt_(pro ... g_library) C library is a strong alternative to TV/FV

Sample widgets/app
Image
marcov
Posts: 3392
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Turbo Vision Library for Free Basic

Post by marcov »

demosthenesk wrote: Oct 01, 2022 14:02 i have installed the 3.2.2 version of Free Pascal with Free Vision and with help chm files separately.
You need to enter the helpfiles in help->files and then button "new". Add toc.chm first.

I've installed 25 years worth of Linux and *BSD distros, so I have seen really a lot of TUIs. But most were more scripting dialogs and nested configuration editors than real universal UIs.

An exception to the rule: in the distant past I've also used tvision based RHIDE. Back then it was the only non commandline UI to GDB.
caseih
Posts: 2047
Joined: Feb 26, 2007 5:32

Re: Turbo Vision Library for Free Basic

Post by caseih »

Although FreeBASIC is somewhat compatible with C++ (GCC anyway) in terms of name mangling and vtables, in generally it's very difficult to interface with a C++ library from FreeBASIC. Maybe if the TVision library does not use any templates, eschews multiple inheritance, and does not use any features of the C++ object model that FB does not know about, it could be possible to translate the header files to FB. But it would have to be a manual translation. I know of no tools for automating the translation of C++ headers. Interfacing with a C++ library from any language other than C++ is very difficult. Often the easiest approach is to write C++ wrappers that expose a simpler interface for FB to use, which is not ideal. I doubt we will ever see full-blown Qt bindings for FB, for example.

Interfacing with a C library is much more practical and there are tools like FBFrog to help translate C header files to FB.

As neat as TVision is (and it indeed blew me away in the 90s), maybe a modern native-FB TUI library along similar lines to Textual is a better way to go. Exploits modern terminals like the new Windows terminal, 24-bit color, unicode, etc, whiles preserving the advantages of being able to work remotely on a remote server.
demosthenesk
Posts: 140
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Turbo Vision Library for Free Basic

Post by demosthenesk »

c++ is the real problem for translating TV to FreeBasic.

i have news.. i tried newt library on linux.
with the help of fbfrog i created newt.bi and now i test it.
newt is written in c and is real simple...

i try to learn now newt.bi and write some examples...
marcov
Posts: 3392
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Turbo Vision Library for Free Basic

Post by marcov »

caseih wrote: Oct 01, 2022 19:19 Although FreeBASIC is somewhat compatible with C++ (GCC anyway) in terms of name mangling and vtables, in generally it's very difficult to interface with a C++ library from FreeBASIC.
True. So don't. Convert the whole library. The current Free Pascal one is also based on an early version of Tvision.

In the late nineties Borland was open sourcing the old stuff, but they stopped before they released the last Pascal based one. We already had preempted that release so when Borland changed course we got into copyright problems and had to rip out the Pascal TV.

We re-engineered on a 3rd part C++ to port Pascal. Unfortunately that port was for a Graphics mode, so we had to do costly reengineering of the coordinate system to blocks back. The whole operation cost us two years
Maybe if the TVision library does not use any templates, eschews multiple inheritance, and does not use any features of the C++ object model that FB does not know about, it could be possible to translate the header files to FB.
Afaik the original is quite clean since developed in lock-step with Borland Pascal. The templating was not that strong in the nineties yet anyway. The 2.0 was never fully ported to Borland Pascal though, that stuck on iirc 1.5 with some additions.
As neat as TVision is (and it indeed blew me away in the 90s), maybe a modern native-FB TUI library along similar lines to Textual is a better way to go. Exploits modern terminals like the new Windows terminal, 24-bit color, unicode, etc, whiles preserving the advantages of being able to work remotely on a remote server.
I don't recognize Texual as a TUI. On me it looks like an textual webbrowser with some smooth fade in of the left bar. I get the impression that somebody backported bunch of GUI metaphores haphazardly to something character oriented and now is trying to promote it as next gen UI.

OTOH, maybe I'm a dinosaur because I always liked the central position of keyboard of the TUIs (and early Windows GUI for that matter, I could install and configure/operate win2000 keyboard only). I also despise the relatively low density and the following excessive need for scrolling and low overview. (and I consider that a problem with many modern GUI concepts too)

I spent quite some time in a TUI (but not TV) mail application for FIDO networks called Golded. For me that app was still the pinnacle of TUI. Intermediate users could operate it _SO_ fast.
caseih
Posts: 2047
Joined: Feb 26, 2007 5:32

Re: Turbo Vision Library for Free Basic

Post by caseih »

I still remember with fondness the text-based gopher protocol and how fast it was compared to the first generation web browsers that tried to replace it. My uni library catalog was accessed via gopher over a telnet terminal. Was very fast and way more usable than the first generation web catalog they came up with.

I also remember fondly WordPerfect 6.1 for DOS which incorporated not only a GUI, but an equivalent TUI that was fully keyboard-driven (or mouse if you desired). A brilliant hybrid I thought.

If one was to port TVision to FB, I suspect it would be easiest to port from the Pascal FreeVision sources, rather than the C++.
caseih
Posts: 2047
Joined: Feb 26, 2007 5:32

Re: Turbo Vision Library for Free Basic

Post by caseih »

demosthenesk wrote: Oct 01, 2022 20:03i have news.. i tried newt library on linux.
with the help of fbfrog i created newt.bi and now i test it.
newt is written in c and is real simple...

i try to learn now newt.bi and write some examples...
Definitely interested to see your examples.
demosthenesk
Posts: 140
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Turbo Vision Library for Free Basic

Post by demosthenesk »

caseih wrote: Oct 01, 2022 22:32
demosthenesk wrote: Oct 01, 2022 20:03i have news.. i tried newt library on linux.
with the help of fbfrog i created newt.bi and now i test it.
newt is written in c and is real simple...

i try to learn now newt.bi and write some examples...
Definitely interested to see your examples.
Here is the newt package with examples from the docs
https://drive.google.com/file/d/1TjKy2X ... p=drivesdk

it is tested on linux
caseih
Posts: 2047
Joined: Feb 26, 2007 5:32

Re: Turbo Vision Library for Free Basic

Post by caseih »

Looks simple enough to work with. thanks.
demosthenesk
Posts: 140
Joined: Jul 15, 2021 7:23
Location: Greece
Contact:

Re: Turbo Vision Library for Free Basic

Post by demosthenesk »

caseih wrote: Oct 01, 2022 23:01 Looks simple enough to work with. thanks.
be aware the newt has no event handler
you have to implement one, see the docs and examples of c files

--------------

i created a github repo
https://github.com/demosthenesk/newt-freebasic
this work is made with the SARG's help, thanks pal! :roll:
marcov
Posts: 3392
Joined: Jun 16, 2005 9:45
Location: Netherlands
Contact:

Re: Turbo Vision Library for Free Basic

Post by marcov »

caseih wrote: Oct 01, 2022 22:28 I still remember with fondness the text-based gopher protocol and how fast it was compared to the first generation web browsers that tried to replace it. My uni library catalog was accessed via gopher over a telnet terminal. Was very fast and way more usable than the first generation web catalog they came up with.
At the uni, there was a real TUI dos client for Gopher. But it was more a gadget than something I really used. IIRC the library search program over Telnet was called VUBIS, but afaik that was a Dutch (uni-) national thing.

I did use Nupop heavily for email (which IIRC was a Turbo Vision program). But Golded was a bit later (32-bit dos4gw) and even nicer. It was used for both netmail (equivalent to email) and echo (roughly newsgroup/maillist alike). Many of the more popular newsgroups were bridged with echomail

And yes, technically with Pascal you have a chance that you can translate large parts at once. But adding the FB generator on the passrc AST would be a bit work.

Also there are a few remaining problems, like how to implement a visitor pattern. Classic Pascal TV implemented that by passing nested functions as visitor (that could access the parent's frame)
Post Reply