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

SetCursor for tcell/views #162

Open
linde12 opened this issue Aug 23, 2017 · 3 comments
Open

SetCursor for tcell/views #162

linde12 opened this issue Aug 23, 2017 · 3 comments
Labels

Comments

@linde12
Copy link

linde12 commented Aug 23, 2017

I was wondering if it's possible to set the real cursor relative to a logical view somehow?

I'm using views.Panel and in the content buffer i want to place a real cursor but i can't find out how. I took a at the cellview example and there is just a "fake" cursor as well. I would like to use screen.SetCursor relative to my view.

Is this possible somehow?

@gdamore
Copy link
Owner

gdamore commented Sep 15, 2017

I don't believe we have given you control over the physical cursor placement. When drawing the cursor needs to move all over the place, and you probably would not like the result -- the cursor bouncing around all over the screen, or fading in and out as we turn it off while we draw stuff.

This is also specific to different terminal types (e.g. Windows is quite different than UNIX).

Is there some reason you need the actual terminal cursor?

@linde12
Copy link
Author

linde12 commented Sep 15, 2017

Ah, what i meant was that i'd like to be able to place the cursor relative to the viewport.

I'm working on a terminal text editor and i have a sidebar(similar to NERDTree in vim) and a text buffer window. I'd like to use the terminal cursor(with correct colors) just like how it's done in vim.

Currently i have to use screen.SetCursor with X and Y values relative to the terminal, not to my View, so i have to add the offsets of where my view is placed if i want to display the terminal cursor.

If there's a easy way to grab the colors of the terminal cursor and apply it to the "fake" cursors, that would also work for me.

You see what i mean? Should i provide a screenshot? What do you think?

@gdamore
Copy link
Owner

gdamore commented Jan 8, 2018

Seems like having a SetCursor method on Views would be a way to accomplish this.

@gdamore gdamore added the views label Dec 25, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants