This is my first post to stack overflow. I've been lurking this site for information for years, and it's always helpful, so I thought that I would post my first question.
I've been searching for some similar examples, but can't seem to find anything.
Ultimately, I'm trying to write a simple text ui for finding false positives and false negatives in a text extraction program. The false positive module is a simple yes/no selection, and displaying colored text and using getch() is easy enough. The False negative portion however, is a becoming difficult.
So this is what I want to do:
- Display a string onto the screen (forget scrolling for now.... ugh) It will only be a string with no newlines.
- The user sees the text, and pushes 'h' to enter highlight mode.
- The user can then control the cursor to move it over a portion of the text (still displayed), and select 'v' to begin highlighting (I trying to make this as close to vi as I can)
- The user then uses control keys (arrows, hjkl) to move the cursor from a starting point to and end point, highlighting the text on the way. This highlighted portion should be a word which is a false negative
- The user presses some key ('y' probably), and the selected text is colored, or stays highlighted, and the highlighted text is save to some variable that I'll handle later.
- The user exits highlight mode and proceeds.
Any ideas to even START? I'm trying simple things like keeping text on the screen and moving the cursor around, but to no avail.
I'm aware of the curses.textpad.TextBox() module, but it performs editing like insertion and deletion, which I don't want to do. Perhaps there is a way to disable it.
I have other questions, but I'll keep this specific for now.
Thanks!!
Neal
Edit: To be more specific, I'm not looking for help writing the whole program, just help moving the cursor over displayed text, highlighting it, and selecting it and saVing it in a variable.