I have a wxWidgets GUI program, and I would like to have a standard console window attached to it for stdout/etc. to go to.
If someone knows how to do this (a GUI application and and a console window) that would be splendid. However, from looking around, I suspect this isn't directly possible.
Based on this similar thread, I got the impression that this could be simulated with a wxTextCtrl in a separate wxFrame. If this is a good way to do it, are there examples of it being done anywhere? Are there other ways to do this?
EDIT: I am looking to either have (or at least emulate as closely as possible) a console window--so, black background, white characters with fixed-width font, etc.
You can redirect e.g. std::cout to wxTextCtrl using wxStreamToTextRedirector but it doesn't really replace a real console under Windows or a PTY under Unix because only the text output via std::cout will be redirected but not anything printed using printf() or any other functions. If you need the latter, you need to do something platform-specific and in this case you should tell which platform(s) are you using and what exactly do you need to do.
I recomend 'upgrading' from stdout to the wxWidgets logging classes, which are way more flexible. Here is an overview.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With