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.
Related
I'm probably way out of the loop, but it seems weird to use a native look GUI library and then - if you're not using wxGTK - shoehorn in a text renderer from a different GUI library. What's the deal here?
I think I understand your point. Using GTK (and Pango Cairo) on Windows, by telling wxWidgets to use internally GTK seems duplicating window managers.
It's just a matter of taste. GTK in Windows does call Windows API to do windowing. But some users like the GTK-way for windows, menus, and other controls instead of the native Windows-way, and wxWidgets provides this feature (in addition, of course, of the native usage, keeping native look&feel).
Anyhow, GTK on Linux calls internaly X11 or Wayland for handling windows and menus. Do you also call this "duplicating"?
The question seems to stem from a mistaken assumption, so it's hard to answer it, let me rather explain how things really are instead:
Cairo-based wxGraphicsContext can be optionally used under MSW because this allows to produce exactly the same graphics output under all platforms, which can be important for some kinds of applications. However it is not used by default, you need to explicitly request it, and if you don't you'd be using GDI+ or Direct2D, both of which are perfectly native libraries.
I really like the feature in Sikuli that allows you to select a screenshot to click and specify where within that screenshot to click. For example when there are multiple buttons that look the same, just taking a screenshot of the button itself won't cut it because Sikuli can't differentiate.
Some other automation tools don't allow you to select where you want the mouse to click within a screenshot, or it is difficult to specify where you want the mouse to click.
So my question is, is there another software tool that has this feature that Sikuli has? The reason I'm looking for something else is because I don't want to rely on image recognition completely. I was hoping to use pywinauto with Sikuli to do some of the automation, but that isn't possible.
There is at least one: eggPlant by TestPlant.
It is an automation tool using image recognition, and
You can search part of the screen by setting the SearchRectangle global property.
References:
http://www.testplant.com
http://docs.testplant.com/ePF/using/epf-finding-images.htm#Working
For Python integration Automa would be nice, and it does have nifty image recognition functions where you can have multiple image parts working together.
Not exactly what you are asking but it just might be of use.
References:
http://www.getautoma.com
http://www.getautoma.com/features/image_recognition
The odds are a bit longer but possibly AutoIt can help you as well. It interfaces with the standard Windows GUI objects and has the benefits of being both very stable and quite easy to use. It has a small tool you can use to show the properties of the screen object you want to access. No learning curve to speak of, however no image recognition or real integration to Python either.
Reference:
https://www.autoitscript.com/site/autoit/
We are using now gehrmann/PyGUIBot (python and free): https://pyguibot.wordpress.com/
Has a command line interface and GUI, records screencasts, with simple graphical programming language. Good for GUI-unittests or user interaction scripting.
Never used it on Windows, only on Ubuntu or Debian, but it looks like a cross-platform tool.
I am looking a bit of simple code that will take whatever data comes from the keyboard at a given moment and let me check it for certain button presses. It doesn't matter what language it is in.
I am looking for a console solution, no GUI.
It sounds like you are looking for the curses library (you may also find an implementation as "ncurses", which is probably already installed on your system). This library powers most of the "full-screen" console programs that you might see on Linux.
On windows, and with c#, I was able to capture another window's "screen", use that for processing, and then send user input events to that window. (which were generated by the program).
I would like to do the same with objective-c and within Mac OS X. So! Any resources or even a name for what I'm trying to do would be great. It's very frustrating to try and find information on this when the only ways i can think to phrase my searches are too ambiguous.
Thanks!
EDIT: As a specific example, there might be a particular game that I want to make an AI for. In that case I would need to be able to send mouse and keyboard events to the game.
If you're looking to do automated user interface testing, look at Squish, eggPlant, expect and OS X Accessibility. If you're looking to programmatically control another program, use scripting (if you wrote the program to control, add scripting support; otherwise, see what scripting support the program offers), or try Automator.
As part of test automation framework building, I need to record the activities done by the user in a video.
Since i could not find a way to record a video directly in vb, i opted to capture a sequence of screen shots (print screens) and then convert it to a streaming video.
Please suggest a way to do the same.
thanks,
pkrg
maybe you can just run another program behind your application.
there are several programs like that.
it is not a professional way but easy way to do this... because probably these programs have already optimized their algorithms...
making avi with jpegs:
there are such a programs that do this too...
again you can search for it..
You can automate Windows Media Encoder there are some samples for C# and VB.NET in the SDK
I would recommend you to use CamStudio to record user activities of your program. It is also open-source.
if you want to roll your own, then
http://support.microsoft.com/?kbid=161299
Shows several ways to call windows api, to caputure the screen or parts of. Still I think you will have problems with the mouse cursor though. After capturing the screen you will have to draw the cursor in the correct position.