Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change attributes of entire line #579

Closed
avlapp opened this issue Nov 20, 2022 · 3 comments
Closed

Change attributes of entire line #579

avlapp opened this issue Nov 20, 2022 · 3 comments

Comments

@avlapp
Copy link

avlapp commented Nov 20, 2022

In curses one can change the attributes of a whole line (with num -1) with chgat.

I've a x amount of columns with text / icons in a filemanager like application. I want to highlight/ reverse the whole line of the cursor position. With curses I would use chgat. Is there similar functionality in tcell?

Edit: I'll try to use textbar from views.

https://tldp.org/HOWTO/NCURSES-Programming-HOWTO/attrib.html#CHGAT

Python curses:
window.chgat(y, x, num, attr)

Set the attributes of num characters at the current cursor position, or at position (y, x) if supplied. If num is not given or is -1, the attribute will be set on all the characters to the end of the line. This function moves cursor to position (y, x) if supplied. The changed line will be touched using the touchline method so that the contents will be redisplayed by the next window refresh.

https://docs.python.org/3/library/curses.html#module-curses

@avlapp avlapp closed this as completed Nov 20, 2022
@avlapp avlapp reopened this Nov 21, 2022
@avlapp
Copy link
Author

avlapp commented Nov 22, 2022

Issue reopened. Sure I could use textbar probably, but with chgat this is so simple to do. A textbar for each line seems to be a bit too much. Maybe I'm overlooking something or maybe something like chgat can be added to tcell if it doesn't exist yet.

@gdamore
Copy link
Owner

gdamore commented Nov 22, 2022

I don't think adding this API to tcell (which is mostly focused with individual character cells) is a great idea.

Conversely, there are higher level APIs where this makes excellent sense. Are you using the views framework? Maybe that would be a good place to add it.

@gdamore gdamore changed the title [question] equivalent of curses chgat Change attributes of entire line Nov 22, 2022
@gdamore gdamore added the views label Dec 30, 2022
@gdamore
Copy link
Owner

gdamore commented Dec 10, 2023

So I'm going to close this as a duplicate of #107 and good news, I intend to do it in the next release. It won't be much effort.

@gdamore gdamore closed this as completed Dec 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants