… Is awesome.
No, seriously wxWidgets, thank you for saving me from the hell that was Agar. Even if your libraries suck to compile, even if prebuilt libraries exist only for older versions, thank you. You are shiny and all that a cross-platform GUI API for C++ hopes to be.
In all seriousness, wxWidgets isn’t terribly easier to learn than Agar was. In case you aren’t familiar with my situation, I am tasked with developing a GUI/graphing frontend for a program that some physics guy at MIT wrote. If you are wondering how Computer Science student got into such a situation, it was a combination of late internship applications, no job offers and a particularly good final project in CMPSC 122. Oh, and a particularly favorable professor for that class.
Anyway, for the last month or so I have been puzzling over Agar and its math library. As I’ve said, I needed to graph things in real-time, and agar seemed to fit that with its “plotter” widget. However, an error (specifically, unresolved external symbol __imp__hypot) in its libraries and a profound lack of support forced me to consider alternatives. I tried out FLTK, and found it not to my liking. I then turned upon wxWidgets, a library that I can’t remember why I overlooked. I downloaded it, and groaned when I saw that there was only source included.
I’m a big fan of prebuilt libraries. As a freshman sophmore computer science student, I have not yet had to deal with cross-platform compatibility issues and the like, so I like my third-party libraries neatly packaged for Windows and MSVC++ 2010. Maybe that’s a bad thing; I’ll have to deal with those sort of issues sooner or later, so I probably should start early. Long story short, though, I tried compiling the libraries and it threw a bunch of errors and I said screw it and went to look for prebuilt libraries. I found them, but they were out of date, but good enough for me. I wanted something that worked, so I could try wxWidgets out first, and not end up having to trash everything and go back like I did with Agar.
So, I downloaded them, and gave wxWidgets a shot, and man am I glad I did. Unlike the two libraries that I used (FLTK, Agar) it is entirely object-oriented, which is an absolute godsend. With the other two APIs, I’d try to pack my interface into classes, only to find that I couldn’t because the callbacks for button presses and other widget events couldn’t take member functions as parameters. There were workarounds, but none that let me use any of the members of the class. So when I’d go to program the button to store a ton of values from the textboxes into variables, I’d find it was impossible. There was a way around it in Agar that involved binding the values inside the boxes to variables, so that when the boxes changed so immediately did the variables, but as I mentioned there were other problems with the API.
Not to belittle small-but-still-useful libraries, but the other thing is that wxWidgets is simply more popular than Agar. It is much easier to get help, since wxWidgets has a larger community. This might be a direct consequence of it being easier to use; I’m not sure, but let that be a lesson to me; your libraries and programs are nothing if they do not have good communities.