gdamore / tcell

Tcell is an alternate terminal package, similar in some ways to termbox, but better in others.
Apache License 2.0
4.6k stars 310 forks source link

Integral functions for areas #107

Open mengstr opened 8 years ago

mengstr commented 8 years ago

This is just a friendly suggestion...

I know there is the "views" package that does a lot of nice things, but some common things maybe could be included directly in the main package.

Like FillArea(x,y,w,h) and possibly also ScrollAreaUp(x,y,w,h)...

Those are things that I almost always have use for in my console-gui applications.

gdamore commented 8 years ago

FillArea is certainly reasonable. I'm less sure about ScrollArea -- I imagine we could scroll but you'd have to fill the newly "exposed" area.

Really, yes, you want "views" here. :-) But the filling functionality could be used by views.

gdamore commented 8 years ago

I'm thinking about this... the API for filling and drawing isn't 100% obvious to me. Same for scrolling. We have to have the bounding box (presumably physical coordinate based), but also then attributes and perhaps a fill character.

Conceivably we could also have a border style.

mengstr commented 8 years ago

I guess that 99% of all usage cases would to fill with space characters with a background color - i.e just clear part of the screen for printing/drawing something new.

The borders would be static, and could/should be drawn separately at the initialization of all the other static elements on the screen. It seems a bit overkill to redraw borders (which is a bunch of differect characters) everytime you clear the info inside the "window".

gdamore commented 11 months ago

I'm probably going to go ahead and do this now. Only 7 years later lol.

mengstr commented 11 months ago

Nice! I guess netter late than never - although I thought the opposite in highschool where I usually rather skipped an entire class rather than coming in like 10 minutes late :)

I must admit that it was quite a while since I wrote a GUI console app, I usually just do plain scrolling text without any cursor control nowadays. But maybe it's time to start making my apps a bit more slick again.