Command line widget like readline/history

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
fll-freak
In need of some credit
In need of some credit
Posts: 7
Joined: Wed Aug 01, 2012 5:25 pm

Command line widget like readline/history

Post by fll-freak »

I am working on a program to analyze data. Rather than being fully menu driven, the user can type in commands.
I envisioned a wxTextCtrl to take in the text then parse and process it when the value changed.
I have a prototype of this that works well enough.

But now I would like to make this interface better by providing features like the C "readline" and "history" routines provide.
Specifically using an up arrow to get to previous commands rather than having to retype them.
Some of the editing features would be nice as well.

Googling seems to indicate that getting an event for each keystroke in a wxTextCtrl is not trivial.
Reimplementing all the features seems like a colossal waste of time.
Before I go down that dark corridor, am I even in the right building?
Is there a better widget already made that would give me the capabilities of "readline" and "history"?

Edit1: Platform is Linux (Ubuntu). Crossdev not needed.
jpo234
Experienced Solver
Experienced Solver
Posts: 70
Joined: Tue Feb 25, 2020 11:34 am

Re: Command line widget like readline/history

Post by jpo234 »

fll-freak
In need of some credit
In need of some credit
Posts: 7
Joined: Wed Aug 01, 2012 5:25 pm

Re: Command line widget like readline/history

Post by fll-freak »

Interesting. I will look at this tonight.
jpo234
Experienced Solver
Experienced Solver
Posts: 70
Joined: Tue Feb 25, 2020 11:34 am

Re: Command line widget like readline/history

Post by jpo234 »

I would also look at the idea to use wxStreamToTextRedirector. Maybe you can attach readline directly to a wxTextCtrl...
Post Reply