How to scroll to cursor in TextEdit, without using ScrollArea? #7157
Unanswered
TetraTheta
asked this question in
Q&A
Replies: 1 comment
-
That is correct. I think this is a bug. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
In C# WinForm, I can scroll to the end of the
TextBox
with this simple code.a.mp4
But I couldn't find out any similar code that is usable in
egui
.By default,
TextEdit
sets its cursor to the end of the text, but this doesn't move its view, so only front part of theTextEdit
is shown.b.mp4
I don't know why only the cursor of first
TextEdit
sticks to end of the text while the cursor of the secondTextEdit
doesn't.But anyway, both are not what I want.
Using
ScrollArea
is not what I want, because by using it, user is basically scrolling the wholeTextEdit
, rather than the content/text ofTextEdit
.I couldn't find out proper method for forcing the cursor to be appear at the screen, just like how I did in WinForm.
How can I do it?
I just found that
TextEditState.singleline_offset
might be used for setting which part of the text are shown, but it is public within the crate itself.Beta Was this translation helpful? Give feedback.
All reactions