tcell icon indicating copy to clipboard operation
tcell copied to clipboard

Integral functions for areas

Open mengstr opened this issue 9 years ago • 5 comments

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.

mengstr avatar May 10 '16 12:05 mengstr

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 avatar May 19 '16 00:05 gdamore

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.

gdamore avatar May 20 '16 20:05 gdamore

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".

mengstr avatar May 21 '16 10:05 mengstr

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

gdamore avatar Dec 03 '23 19:12 gdamore

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.

mengstr avatar Dec 04 '23 14:12 mengstr