Thursday, 5 June 2008

C++ Standard GUI


#include <gtkmm.h>

namespace std
{
namespace gui = Gtk;
}


I love gtkmm.

6 comments:

Zdravko said...

I like Gtkmm too. It has a relatively modern C++ structure in terms of OOP, class hierarchies and usage of references, e.g.
Gtkmm looks very good, because it is a wrapper of a "complete" GUI library - Gtk.
Now, the downside - horrible support for the Windows platform. There is an incompatibility bug with Vista and Visual Studio 2008. Debugging a Gtkmm application under Windows is impossible. The run-time libraries there, impose also a significant impact. Menus are erased with a blank white rectangle when the mouse hovers them - just to name a few of the bad bugs. So far, there is no solution for them. I follow the Gtkmm mailing list and read recently that newer versions for the Windows platform are expected.
Btw, C++ has no standard GUI library and your "namespace-hack" does not make Gtkmm standard in any way. A standard library for C++ would mean that a standardized interface and platform-targeted implementation is provided. While Gtkmm succeeds to provide the C++ interface, it completely fails the implementation part.
I cross my fingers and pray for a standard C++ library, because it is indeed needed! A good start would be boost::gui. Then it can make it into a trXYZ, and eventually - in std::.

Best regards

Sohail Somani said...

Very good points but one has to start somewhere. I think Boost has gotten to the point where it is very difficult to get agreement on anything that people feel they understand because of design-by-committee. Boost GUI, quite frankly, is never going to happen, not without involving a dictator (which is fine with me).

Have you filed a bug for the menu hover problem? I looked in the gtk bugzilla and couldn't find any. I don't have Vista so I can't really test.

Why is Gtkmm difficult to debug? I've debugged just fine. I hate debugging anyway though :-)

Zdravko said...

I wrote a letter concerning the bugs in the gtkmm mailing list. I got no reply.
The basic problem might be Vista itself. I am forced to use Vista so I don't have much choice. Under Linux everything is fine. But how can a library be called standard when it's implementation is buggy on certain platforms?
A gtkmm project fails to run in debug mode - this is what I meant. I hate debugging too, but debug mode is turned on by default and I expect by hitting Ctrl+f5, that my application will just run.

Sohail Somani said...

"But how can a library be called standard when it's implementation is buggy on certain platforms?"

Actually, many implementations of the C++ standard library were quite buggy and non-standard for quite some time. So its quite normal. Anyway, it is to the detriment of the vendor if the standard library does not work as advertised because people would use something else.

"A gtkmm project fails to run in debug mode - this is what I meant. I hate debugging too, but debug mode is turned on by default and I expect by hitting Ctrl+f5, that my application will just run."

Hmm... My guess is that this is more to do with your setup than anything else as I've done this.

Zdravko said...

"My guess is that this is more to do with your setup than anything else as I've done this."
I will give gtkmm a try once more and tell you the results, okay?

Duzy Chan said...

You will need a bundle of DLLs or SOs of gtk, this means you will need to port gtk & gtkmm to your platform firtly.

Your solution is not STANDARD portable.