Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I've done some work with this tvision port as well. Every time I use a new TUI framework, I'm disappointed. Invariably, Turbo Vision is better.

I'm actually working on my own .NET wrapper, too. I don't think I'm as far as you, though. I'm mimicking the Windows Forms API as closely as possible and I want to have a drag-and-drop TUI designer.

Some examples of my wrapper: https://github.com/brianluft/terminalforms/tree/main/src/Ter...

I did most of the hard integration work on the C++ side: https://github.com/brianluft/terminalforms/tree/main/src/tfc... -- exporting simple C functions that I can call with P/Invoke so that the C# side is mainly about organizing into classes. It took a couple tries to find a design that didn't fall apart when I got into more complicated stuff. Initially I went too hard into "everything that you can do in C++ should be possible in C#"--this was maddeningly complex. I was using placement new to stick the C++ objects into C# buffers, you could effectively subclass the C++ classes from the C# side, it was getting way too involved. I switched to a much more direct and less flexible approach. I decided the flexibility should be on the C# side.

I'm curious how your P/Invoke system works.



Nice! Mimicking that API is a great idea - a very different approach to mine and I love seeing it :) We shall clearly be in great competition in the future!

(Joking aside, I actually hope great cooperation, not competition... it's what open source is for. Seeing someone else is making a .Net wrapper as well is just plain awesome and I wish you the best. I really like the different API style.)


Definitely. Reach out to me or magiblot if you ever need any help. I love this stuff, and magiblot is extremely responsive. They have helped me many times and even made changes to tvision to support my use cases.

As a stretch goal, you might try to integrate https://github.com/magiblot/turbo too. This is a Scintilla-based text editor control implemented in tvision. We worked together to make it embeddable in other programs (because I wanted it in mine). Example usage: https://github.com/tmbasic/tmbasic/blob/master/src/tmbasic/C...

Also, I assume you know about the Turbo Vision Pascal and C++ books. They're really helpful. I transcribed both books to Markdown for easy searching if you want it.


I will, and thankyou.

That editor is really impressive. I'll see if I can wrap it too! Can I ask what your editor integration is for, what project?

I know the books exist, but I haven't read them. It's possible I even had a copy as a child - we had many of them but I never wrote Turbo Vision code, just Turbo Pascal in plain text or graphics modes. Then I moved on to Delphi. I would love to find both in MD - are they publicly available?

I realised I never answered your question about P/Invoke: I wrote (as in got an AI to generate) a flat C wrapper using the handle pattern, and then reimplemented classes back in Oxygene Pascal. I'm experimenting with new controls now, eg a tab/page view and others. Each is just a class that has its own view, plus some management extras, such as what max rendering it supports (I'm adding DOS character sets through to Powerline in rendering tabs, borders, etc.) It's all churning quite a bit as I do something, realise it may not be the best approach matching the TV model, rethink - learning a lot about TV's architecture at the time - so no more solid answer than that currently simply because it may be outdated tomorrow :)

Rather than focusing heavily on inheritance, I'm leaning more towards soft interfaces (duck typing) and wrapping via composition. This is just personal preference. But the concept is, if something looks like it is able to hold controls, it is treated as though it can hold controls, for example.


I used it for https://tmbasic.com to build an IDE in the style of Turbo Pascal for my toy language. Originally, I was going to implement the TV wrapper framework and UI builder in this project instead, so you could write TUIs in TMBASIC, but that ultimately felt like a waste for a toy language. With .NET someone might actually use it :P

I've sent you an email with the Turbo Vision books in Markdown, if you didn't receive it, hit me up via the email in my profile.


Must be serendipity as I’ve been working on a TUI drama nd drop designer like a terminal Visual Basic 4. I’ve tried Visual Basic for dos and it was as streamlined as the windows version




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: