Closed ghost closed 8 years ago
I don't know what "a console like the source engine's" one looks like. Why would you use a multi-line text input for a console? It sounds counter-intuitive to me. Have you looked at the Console example and could you clarify how it would differ?
still, from the console, I want to be viewing the last printed lines, allowing them to scroll upwards to view previous commands, like a TTL console. I am unsure how it is unintuitive, BUT i'm not here to argue
I think you want an automatic scroll-to-bottom when a new line gets added (perhaps only if it was scrolled to the bottom already when the line was added).
Exactly what I meant @ratchetfreak
The confusion is that you said "multi-line text input" when you meant "the output". They are different things since you aren't inputting text inside the zone that is scrolling, you are inputting text in a single-line input box.
What you are describing more or less what the existing Console example is doing. This is why I asked if you had looked at this example first.
You can't select individual lines of text (for clipboard copying) in that example, but you can copy the whole content into clipboard. If you are content with single color text-only non-interactive console and want precise selection, so can also replace the display by a read-only multiline text-input, if you Begin() inside the same child window you can call SetScrollPosHere() manually as a little hack to manipulate the scroll from the outside of the widget. But it'll be easier and have more advantage just going for what Console example is doing.
TL:DR; check the Console example in the demo and let me know if there's something it doesn't do that you want.
I'm not sure where the examples in the source tree in all honesty, i saw the GL3 &c, but no console. Unless you meant the ones referenced in Readme.md
In imgui_demo.cpp Function ImGui::ShowTestWindow() This is the function that is called by all the examples app. You can't really learn any imgui without this reference code so you've probably seen this demo :)
The Console demo is available from the menu bar.
ah! The menu bar
I feel like an idiot now /close
No problems. If you feel there's something I could improve in the files/doc so I that you would have found it, let me know.
Enhancement:
In a multi-line Text input, the option to have it automatically scroll to the base of the pane would be nice, or to allow it by function on callback. This will allow me to create a Console Like the Source Engine's.