McParen / croatoan

Common Lisp bindings for the ncurses terminal library.
Other
146 stars 13 forks source link

Any form.h support? #8

Open ahungry opened 6 years ago

ahungry commented 6 years ago

First off, thanks for the project, it looks really great.

Now, on to my question:

http://www.tldp.org/HOWTO/NCURSES-Programming-HOWTO/forms.html

Just wondering if there was support or bindings for forms built in? Preferably in a CLOS or simplified manner?

If not, do you know if cl-charms supports it? (or, if there are low level cffi calls available, or would I need to run form.h through swig or something to generate bindings?)

McParen commented 6 years ago

Hello,

I don't have any support for forms yet. I will add support for forms eventually, but it could take a while.

cl-charms or cl-ncurses do not yet have any low-level support for forms either.

At this moment, you will have to generate your own bindings, either by swig or manually. I do not have experience with swig, so I cant help you there.

Good luck.

Demosthenexx commented 6 years ago

I'm excited to see the new forms tests! I'm trying to run some, and edit was complaining that scr wasn't included in the win argument. I'm likely jumping ahead, but thanks for working on this.

McParen commented 6 years ago

If you found a bug, or if I can help with your code, dont hesitate to ask.

Demosthenexx commented 6 years ago

What are your plans for the forms?

One of the items that I'm looking for is data entry fields with autocomplete, perhaps as a custom widget if needed. Could the current code support that?

I was pleased to tinker with your test code and it looks like a tab oriented CRUD form could be done with it.

EDIT:

I noticed the blocking/nonblocking inputs (100% in the notes). Is there an option to have any kind of concurrency to do other tasks while waiting for input (ie: for the autocomplete text entry widget, maybe the lookup doesn't cause the client to stop typing)?

McParen commented 6 years ago

If time permits, I'm going to reimplement the functionality of ncurses forms library. But that will take some time.

The current code is very, very far from what the ncurses forms library provides. Autocompletion similar to emacs company mode is a long-term goal, yes, but I dont think I'll get it done in the near future.

Demosthenexx commented 6 years ago

I believe that's the crux of the matter: whether you reimplement or just import form.h.

Autocompletion is an add-on that could be custom coded if everything is in lisp.

dokpm0 commented 4 years ago

I would also love to see a forms implementation, once I learn enough Lisp to make use of it. The one feature that I usually find lacking in most TUI libraries I've used that I'd love to see would be what some call an input template. For example. for a phone number entry field, I prefer to have the interface display the filler characters "( ) - ", and automatically skip over them as data is entered. I was spoiled by that functionality in dBase back in the '80s. In dBase, it was as simple as:

@ 2,5 Say "Phone Number:" Get PhoneNumber Picture "(999)999-9999"
Read

It would skip over the ()- filler characters and only accept numeric input in each position containing a 9.

Demosthenexx commented 4 years ago

God I'd LOVE to find a TUI dBase clone.

dokpm0 commented 4 years ago

dBase was interactive. Eventually a compiler for the dBase language came out named Clipper. Harbor is an open source implementation of the Clipper compiler:

https://Harbour.GitHub.io/

Unfortunately its TUI does have some limitations, like only having seven colors, and the only controllable text attribute is highlight. So one can't do things like underlining input fields. That's why I keep searching for better TUI libraries.

Demosthenexx commented 4 years ago

I've looked at Harbour. I just can't stand the language. You'd think a modern language would have TUI library. Every language I used in school had one by default.

McParen commented 4 years ago

You only can have a complete library if somebody sacrifices his time and actually works on it. The time I can invest is very limited, so progress is very slow.

It makes no sense to expect a tiny hobby library in a niche language to ever match functionality offered by systems like dbase, vb or turbovision that were funded by massive corporations and had hundreds of thousands or even millions of paying users back in the day.

My suggestion is that you should look into contributing to the forms implementation. If you have an idea you'd want to see, try to implement it yourself. It could take years waiting till somebody else does it.

Demosthenexx commented 4 years ago

I don't have expectations of delivery. I appreciate the work you've put in. We're only commenting here because it's relevant. Thank you for your work so far, and perhaps we can together get a forms solution going sometime.

dokpm0 commented 4 years ago

McParen,

On Tue, Oct 29, 2019 at 11:49:02AM -0700, McParen wrote:

You only can have a complete library if somebody sacrifices his time and actually works on it. The time I can invest is very limited, so progress is very slow.

My main intent was to express interest in the forms functionality. Your time and progress are appreciated.

It makes no sense to expect a tiny hobby library in a niche language to ever match functionality offered by systems like dbase, vb or turbovision that were funded by massive corporations and had hundreds of thousands or even millions of paying users back in the day.

I have no expectations. I only mentioned the input template functionality as a suggestion. The only open source ncurses widget library I can remember seeing such functionality in at the moment is the CDK widget library. I thought it might be functionality none of the contributors to this project had thought of, but one or more might find useful.

My suggestion is that you should look into contributing to the forms implementation. If you have an idea you'd want to see, try to implement it yourself. It could take years waiting till somebody else does it.

I'm just learning Lisp. If I get far enough along with the language that I could attempt an implementation without doing more harm than good, I'll give it a try.

--

Kevin http://www.RawFedDogs.net http://www.Lassie.xyz http://www.WacoAgilityGroup.org Bruceville, TX

What's the definition of a legacy system? One that works! Errare humanum est, ignoscere caninum.