-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
Terminal/In Game Console Widget #319
Comments
Maybe try using one multiline TextEdit for scrollback and one singleline TextEdit for input? |
The hard part here is making the multiline widget scroll down to the most recent line added. As currently implemented, there's no way to scroll down to the most recent line. |
Yeah, I'm trying to figure that out too. Currently this is what I have, but resizing the window doesn't work (it just slides back), so the scrollbar is never shown: ScrollArea::auto_sized().show(ui, |ui| {
ui.text_edit_multiline(...);
ui.scroll_to_cursor(Align::BOTTOM);
}); |
Oh cool I'll try that and see if that works better than what I'm doing now.
…On Wed, Aug 11, 2021, 5:48 PM Kot ***@***.***> wrote:
The hard part here is making the multiline widget scroll down to the most
recent line added. As currently implemented, there's no way to scroll down
to the most recent line.
Yeah, I'm trying to figure that out too. Currently this is what I have,
but resizing the window doesn't work (it just slides back), so the
scrollbar is never shown:
ScrollArea::auto_sized().show(ui, |ui| {
ui.text_edit_multiline(...);
ui.scroll_to_cursor(Align::BOTTOM);
});
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#319 (comment)>, or
unsubscribe
<https://github.com/notifications/unsubscribe-auth/AGV4FZ7QBMP74SEP6WCBHHLT4MD6BANCNFSM43EMA6NA>
.
Triage notifications on the go with GitHub Mobile for iOS
<https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675>
or Android
<https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email>
.
|
It probably doesn't, because it just expands endlessly until I figure out how to make it resize properly :P |
Seems this is a known issue: egui/egui_demo_lib/src/apps/demo/tests.rs Line 424 in 9603bb4
|
I have built a console window that you describe, its got complicated pretty fast. I was wondering about making it a free standing widget. Trying to make it scroll whole lines rather than stoppig with half a line shown I thought about 2 (or even three) widgets: history, prompt (static text) and command line. Problem is that you would not be able to mouse highlight the history and command line (for copy), which would be kind of odd. You dont want that scroll to last all the time, becuase it messes with people scrolling back to look at the history |
Is your feature request related to a problem? Please describe.
I'd like to build an in game console but there does not seem to be a way to do this using the multiline text edit.
Describe the solution you'd like
I'd like a widget that has a way to scroll the cursor to the last character in the text box. Additionally, it would be amazing to be able to color specific text blocks in the output for errors and logging, etc.
Describe alternatives you've considered
I tried to use a multiline text box but when the buffer is modified (to add the prompt), the cursor stays behind the new text, and there is no way to move the cursor programmatically that I could find.
Additional context
Is there a way to move the cursor to the end when the buffer is modified?
The text was updated successfully, but these errors were encountered: