Domain: gtkmm.org
Stories and comments across the archive that link to gtkmm.org.
Comments · 35
-
Re:For me, there are no Big *Two.*
Although it isn't much, KDE is also closer in design terms to the UNIX philosophy as well; the different parts are more cleanly encapsulated than GNOME, and it's more self-contained, as well.
On the other hand, if you look at it from a developer's side, GTKMM (the C++ interface of GTK) might be closer to the UNIX philosophy of "do one thing only, and do that right". While Qt reinvents the wheel so many times, by using its own classes for many things, like QString or QThread, or by implementing its own slot & signal system with a C++ preprocessor, GTKMM uses standard and existing libraries wherever possible.
Qt: QString, QList, QVector
GTKMM: std::string, std::list, std::vectorQt: Signal handling with macros and its own custom C++ preprocessor
GTKMM: libsigc++, template-based signal handlingOf course that's just one way of looking at it but I wouldn't call any of the two less close to the UNIX philosophy. On the end user's side, both have an abstract VFS to file management on remote resources, etc...
That said, kongratulations, Matthias! I hope this award encourages others to dedicate their time for the greater good.
-
Re:Qt
FTFY. See the GtkMM Documentation as well as the mainline GTK documentation.
FTFY
:p -
Re:Qt
GTK didn't used to have the well written documentation that Qt has.
TFTY. See the GtkMM Documentation as well as the mainline GTK documentation. The newer documentation, including that for the PyGTK Python bindings, is some of the best-written API documentation I've ever seen.
-
Re:It's good news, but is it too late?
Have you ever used GTKMM? Why is it so "unproductive"? Are they http://www.gtkmm.org/commercial_support.shtml all wrong?
-
Re:The real news is Vala
What about the C++ interface to GTK+?
-
Re:Different designs
Only after I point out that there are some amazing C++ bindings for GNOME called gnomemm, created by the gtkmm crowd.
-
Re:Would rather it be GTK or Qt based.
As for what is wrong with GTK + C? Well nothing is wrong with it but it's not the only choice. One thing to keep in mind though is that graphical displays usually consist of conceptual objects "windows", "buttons", "listboxes", "textboxes", etc. These are all "things" which to be honest, creating code to describe "things" is what object oriented programming excels at.
To be fair, there is gtkmm and PyGTK which are both awesome ways to do GTK development.
-
Or gtkmm
gtkmm is a nice C++ inteface to GTK+ if you want to code in C++ and GTK+.
-
Re:I know nobody wants to admit it...
What produces Windows applications that are as small as WTL/SDK, and don't "look like Ass" to quote another poster?
Good question, given that "look like ass" is highly variable from person to person. I think Windows apps look like ass. YMMV.Mono is like a third rate knock off of
"Third rate knock off" ignorance aside, it's a cross-platform development framework. Just one more example. I can't vouch for how bloated or not the applications it produces are. .Net, which seems pointless to me since the original produces bloated applications.XUL seems to be some Mozilla internal XML handwaving used by Firefox, and not be much to do with developing small GUI applications.
For your reading pleasure, a book on programming with XUL. If you know XAML, XUL is what Microsoft was ripping off to create XAML.If portable GUI class libraries didn't suck so much, people would use them instead of the non portable Microsoft solutions
But, if Microsoft didn't have a stranglehold on the market, there'd be even better cross-platform solutions than there are now! You're taking current market conditions and extrapolating out from there which isn't a valid assumption (even if existing cross-platform tookits actually did suck!)Looking more at WTL (links here), I am so very glad I'm learning gtkmm instead of it.
-
Re:Sometimes I wish I weren't such a sux programme
I use gtk+ instead of Qt because the licensing. Either way there's gtkmm that uses c++ anyway so your argument there is moot.
-
Re:A better title would be "Why use a toolkit"?
GTK+ is the toolkit, it's no longer known as simply GTK, GTK-- (http://www.gtkmm.org/) is the C++ bindings to the toolkit, i guess since you've come back from reading the article with the misconceptions you've displayed so far we can safely say that it's not a useful or well written piece. I'd have expected some coverage of the miriad of different language bindings available for GTK+ in such an article, maybe all of the
/. feedback will help him produce something useful in his next installment. -
Development of GTK+
These days any serious developer doesn't use plain GTK+ anymore. If you want to get productive on Linux you either use gtkmm (http://www.gtkmm.org/) or wxWidgets (http://www.wxwidgets.org/), both based on GTK+. If you also develop for Windows you're better off with wxWidgets.
see also http://developers.slashdot.org/comments.pl?sid=172 263&cid=14343909
O. Wyss -
Re:QT is a cutie
There's a complete C++ wrapper of GTK+, it's called gtkmm.
-
Re:While it would be nice...out of interest, what's wrong with std::string?
It doesn't support Unicode well. Specifically,
- It doesn't support variable-length character encodings like UTF-8 or UTF-16.
- wchar_t is not a standard size. (It may be two or four bytes, depending on your platform.) So you need to define your own ucs4_t specialization to portably hold wide characters.
- There's no decent transcoder in the standard. boost has utf8_codecvt_facet, but currently it's for internal use only. (With a class like this, you could use std::string with above ucs4_t and still do UTF-8 I/O.)
The best workaround I've found is to require Glibmm. It's a huge dependency, but it has a UTF-8 string class and appropriate conversion functions.
But fuck workarounds. I'd rather just code in a language with a standardized string class that doesn't suck. This sort of thing is why my largest C++ project is stagnating while I write code in other languages.
-
Re:The Gnome way
pretending that a C++ version of the gtk header exists
...since, of course, there are no such things as C++ bindings for GTK+.
Your code snippet is nice pseudocode, but I doubt a real-world version would be that clean, even in C++. His C code, even if uglier, actually compiles and works. I'd be curious to see a Gtkmm version of the same thing.
-
Re:QT GTKQT ist simply the better API
Don't compare apples to oranges. QT has a C++ API, whereas GTK+ is plain C. Better compare QT against gtkmm, the GTK+ C++ bindings.
-
Re:GNOME
1) Miguel de Icaza.
Oh that's brilliant, change desktops because you disapprove of one guy. I guess no one should buy Macs because Steve Jobs is kind of annoying.
A free clue for you: GNOME does not depend on Mono, nor Mono on GNOME.
This is a non-reason.
The Lack of decent or equivalent KDE development tools.
The tools are there, but they don't all start with a "K" (or even a "G").
KDevelop? Anjuta.
KDesigner? GLADE. (I'm guessing. I googled KDesigner and it didn't find anything for me. What's KDesigner?)
Maybe you like the KDE tools better. Heck, they might even BE better. But this is a non-reason for you to change your personal desktop.
3) The Object Oreintation Thingy.
Oh that's really brilliant, base your choice of a desktop on something like this. Here's a clue, it's easy to wrap C so you can call it from any language; the GNOME guys willingly put up with the lack-of-features in C to make it easier for everyone else to interface to GNOME in any language at all. You can do object-oriented programming in any language, and the GNOME stuff is decently OO. Just get a C++ wrapper like gtkmm and you are there.
I would hate to see the distro's...drop GNOME.
Something we agree. -
Re:GTK is out, then?
-
Re:Sounds like I need it.
-
Re:Sounds like I need it.Python has some nice bindings, and what better to go with a crossplatform toolkit than a cross platform interpreted language. Also, SIP (the tool used to create the bindings) finally works under OS X.
A downside to QT is that it is not free under windows. While this might be okay with companies, if you ever considered writing crossplatform OSS programs, this can hamper things. There is a project porting the X11 version to windows, so its not a complete roadblock..
Of course there is always GTK which has been known to also run under windows and OS X. It is not my intention to start any flamewars -- I am just pointing out that for those in favour of either toolkit there is plenty of crossplatformability.
If either TK holds any major advantage its that GTK+ natively supports C code, but also has C++ bindings. The signalmm library that came out of gtkmm is actually really nice, and usable for other projects. However, in that case don't forget about boost, which also contains a signal library, not to mention a *really* nice interface to python (which I'm currently using in a project). Just be warned, you need a fast computer for compiling.
-
Re:Eeek...If you have ever coded in one of these languages you would know it increases productivity beyond anything possible in C or C++.
With the right tools, development with C++ can be a satisfying experience as well. I've written a couple of apps
with gtkmm (a C++ wrapper around GTK+) and found the experience similar to coding with Java and Swing. Aside from the convenience of garbage collection - the need for which is partly a function of your coding style and habits anyway - the appeal of Java is largely in the class libraries that come with it. The choice of class libraries can easily make or break your experience with C++, as well. -
Re:C++ Interface?
It is: gtkmm.
-
Re:non commercial QT?
-
Re:Qt.
Qt is probably the best C++ GUI toolkit out there. In my experience, developing an application is extremely easy and straightforward, due to the fact that the people at TT used the simple (yet effective) model of slots and signals. Writing a new event handler is as simple as overriding a method and then connecting it to your widget -- simple as that.
Try gtkmm if you like signals and slots. No preprocessor required with gtkmm, either - IIRC, Qt relies on moc or something like that to preprocess C++ source files for signals & slots?? -
Re:I need to askSorry but this is dumb. If you want to use C++ with GTK it is as simple as writing a class with methods that call the C counterparts. If you prefer you can use one of the ready-made C++ bindings that already exist for GTK such as the official gtkmm. It's not that GTK 'hates' C++, rather that it makes no sense to implement the base API in high level C++ and shut out every other language in the process.
In other words if you like things abstract you can have it, if you don't or require low level access you can have that too. I'm comfortable with either way. On Win32 for example I'll use WTL / ATL (I despise MFC) for the general moving windows around and layout, but will often drop to Win32 APIs when using wrapper classes is pointless.
So I suggest there that some people have valid reason for shunning the 'obvious technical merits' of QT. I don't disagree it has its own strengths, but requiring someone to program in C++ to use it isn't one of them. -
Re:Week's salaryI do agree that the QT docs are very good and better then GTK+. Though saying that the API is great is a personal opinion. I personally don't think it is great and prefer wxWindows. By the way, wxWindows is FREE to use under MS Windows, Mac and Linux. I don't like the Meta Object compiler for QT required to do signals/slots. It is old cruft left over from the need for older C++ compilers. Gtkmm is a C++ toolkit for GTK that uses signals and slots and has no need for an aditional precompiler. According to QT's docs, there are a bunch of Limitations with QT's signal/slot implementation:
class templates cannot have signals or slots
Multiple inheritance requires QObject to be first
Function pointers cannot be arguments to signals or slots
Friend declarations cannot be placed in signals or slots sections
Signals and slots cannot be upgraded
Type macros Nested classes cannot be in the signals or slots sections nor have signals or slotsacros cannot be used for signal and slot parameters
Constructors cannot be used in signals or slots sections
www.wxwindows.org, IMO is better then QT and can be used to develop Open Source as well as closed source, propreitary applications. There is an impressive list of people using wxWindows including commercial companies such as AMD and Xerox who uses wxWindwos. The feature set is impressive as well. -
Re:Week's salaryI do agree that the QT docs are very good and better then GTK+. Though saying that the API is great is a personal opinion. I personally don't think it is great and prefer wxWindows. By the way, wxWindows is FREE to use under MS Windows, Mac and Linux. I don't like the Meta Object compiler for QT required to do signals/slots. It is old cruft left over from the need for older C++ compilers. Gtkmm is a C++ toolkit for GTK that uses signals and slots and has no need for an aditional precompiler. According to QT's docs, there are a bunch of Limitations with QT's signal/slot implementation:
class templates cannot have signals or slots
Multiple inheritance requires QObject to be first
Function pointers cannot be arguments to signals or slots
Friend declarations cannot be placed in signals or slots sections
Signals and slots cannot be upgraded
Type macros Nested classes cannot be in the signals or slots sections nor have signals or slotsacros cannot be used for signal and slot parameters
Constructors cannot be used in signals or slots sections
www.wxwindows.org, IMO is better then QT and can be used to develop Open Source as well as closed source, propreitary applications. There is an impressive list of people using wxWindows including commercial companies such as AMD and Xerox who uses wxWindwos. The feature set is impressive as well. -
Re:-1 Troll(tech)
The namespace concern is the only minus point with any merit - on the other hand, I don't see Gtk+ using namespaces either, and that wasn't mentioned as a minus point, was it? (Yes, I know Gtk+ is written in C - but that doesn't alter the fact that it too does not use namespaces)
But, GTKmm does use namespaces. It uses a lot more modern C++ features than QT does. To be fair though, I've not done more than read a tuturial, so it might not be all that hot for all I know. -
Re:Thats spin.
Except that your model does not permit for the exchange of their information prior to the full payment for their design. As a consumer you are not permitted to know anything about their design, until they have been sufficiently compensated. You haven't shown that this model is superior.
The information as a service model is better for consumers and it is proven. Check Linux vs Windows
1. Demonstrate that "Linux vs Windows" is an example of the aforementioned scenario.
2. Show that if "Linux vs Windows" is an example, that any and/or all results are applicable to all assets in an information economy.
3. As you imply for your statement to be considered a response to the aforementioned claim for proof, and imply that such proof is existent, demonstrate a proof of the economic superiority of the aforementioned model of distribution.
Linux has advanced this quickly
Linux has been in development for almost twelve years, and many parts of its userland even longer. because information has been shared between competiting companies, Redhat, Suse, and others.
Companies that also have proprietary sources of revenue.
You didn't mention some of the other names, though, that have contributed code, money, or expansive technical information like Intel, IBM, Compaq, HP, CMI, and more. Companies that have no qualms with, or outright desire to make a commodity of operating systems, or the software market altogether. Companies that rely extensively on intellectual property protections for their own sources of income. Do you see Intel or IBM calling for the removal of intellectual property protections, citing a better economic result as their motivation? Do you even see RedHat doing that?
Redhat is profiting
I really hope you can do better than this, although I would be entirely interested in an explanation as to why you believe that this is evidence demonstrating the benefits of removing intellectual property protection.
And while I think your childish obsession with comparing Windows and Linux as a means of determining the success of such a model is more than a little cliche and incredibly useless, you can always take a look at how big a failure Microsoft is in comparison to RedHat. If you could even relate RedHat to your ideology, which is rather suspect at the least, you would probably do better to find a better example.
and other companies are trying to profit
Would that be more like MandrakeSoft, or more like VA Linux Systems/VA Software?
programmers are paid to produce code, not to sell it.
The number of programmers responsible for selling, rather than producing code, is anecdotally small. Intellectual property protections are most often used in either scenario.
This does benefit the user because we get better software
Do we? This certainly seems subjective to me. It hardly matters, however. It also doesn't lend any support to your ideology.
the wheel isnt constantly reinvented
The is constantly reinvented, on this planet where is your -
Re:OMG!I really hate to second something even vaguely pro-MS, but there are definitely issues with gnome. Recently, I tried to compile all the stuff you need to develop with gtkmm and HOLY JESUS what a monumental pain in the ass that was, let alone the paucity of documentation. I know it's free and all, and presumably I should contribute instead of whine (if I were to continue down that track), but we are talking about existing barriers to entry.
Windows is a stable, unified platform that can be leveraged without fear of one's products becoming obsolete or broken with the next release
This is only partially true.
-
Re:Incredible!
gtkmm, and also the fact that wxwindows on it's *nix counterpart is just another C++ binding for GTK.
-
Re:"Race KDE cannot win"Lets face it, C is not well suited for window environments.
This FUD should have been dispelled a long time ago. The C++ bindings for GTK/GNOME are excellent, in fact they are mor C++ish than Qt, as they make proper use of the standard library, as opposed to Qt that reinvents a lot of it (QString et al) for portability to ancient platforms and needs stuff like a preprocessor for its object model. Check it out before you bash gnome again.
If you like C++, use it! Nobody is forcing you to use C. The fact that a lot of Gnome software is written in C is because the coders prefer C, that's it. No, really. They do. C++ is a hard, amazingly complex language that isn't to everybodies taste.
Look at Windows. MFC is just C++ classes aound C stuff.
The MFC is a good example of how NOT to make bindings, don't write off all language bindings because you had a bad experience with one.
What that the License gets you though, is the ability to ship the same high-grade apps on Windows as on Linux, Mac OS X, and whatever other platform you want.
Only if you stick to Qt of course, and pay up (a LOT of money) for each developer. If you want to use the KDE classes, not all of them are available on Windows or MacOS, so....
This could singlehandedly be the missing element to bring Linux to the masses.
Actually GTK apps are ported to Windows far more often, because you don't have to pay to do so. Try again.
BRING BACK HARMONY.
Oh yeah, that's nice. Why not, and destroy TrollTech at the same time. Do you have any idea how much effort would be required to recreate Qt? A widget toolkit is often many millions of lines of code, and Qt doesn't just do widgets, it does strings, threads and lots more.
The solution is to make GTK and Qt interoperate better, share theming engines and so on, then you can choose which toolkit you prefer. GTKmm and Qt are basically very similar anyway.
-
Slashdotted already!Interview by Christian Fredrik Kalager Schaller
If you have followed GNU/Linux for the last few years you know that GNOME has long been a stronghold of C, Perl and Python GUI programming. With Ximian's work on Mono, C# seems also to be a language that will see wide use in GNOME. Sun's involvement should also make Java applications integrate strongly with GNOME. But what about C++? Even in the GNU/Linux and Unix world this language has received many advocates and developers. I sat down with Murray Cumming, lead developer on the gtkmm and gnomemm C++ bindings for GTK+ and GNOME to get some information on the status of C++ development in GNOME.
Christian: What is your background and what puts food on your table in real life?
Murray: I'm a freelance developer, though that's difficult in the current market. I do C++ development on Unix, on all kinds of projects, such as protocol implementations, compilers, interpreters, data converters, management systems, and GUIs to make sense of all these. I've lived in Munich, Germany, for the past 3 years, but I'm officially a Brit. I love Munich's healthy outdoors lifestyle and easy-going socialising. I try to put the Lederhosen out of my mind.
Over the past ten years I worked my way up through paper-shuffling, data-entry, typography/design, tech-support, database consultancy, and Windows development. I didn't learn programming at a college, and I still stubbornly believe that it made me a better developer. You have to really care about something to teach yourself in your spare time.
I didn't use any Unix-like systems until Linux was widely available. People forget that before Linux you had to go to University to use Unix. Some companies had big Unix boxes, and the staff who used them generally earned huge sums because they knew how to move files around. Naturally they didn't let anyone else near them.
I've grown to love the control that Unix gives you but I've done hardcore GUI development on MacOS and Windows, so I know there's more to life. Unlike lots of GNOME developers, I know that the Mac is a worthy influence but that Windows gives us nothing to chase.
Christian: How did you get involved in developing gtkmm and gnomemm?
Murray: I was originally just a user, more attracted to the up-to-date gtkmm than the awkward (and then non-free) QT. I did the carthorse work necessary to get gnomemm 1.2 usable and stable, and that's how I learned about the general issues involved.
Then I decided to make a big effort to get gtkmm2 going, when it didn't look like anyone else was going to do it. Karl had the beginnings of gtkmm2, but it didn't build and he was reluctant to show it to the world, fearing that people would expect a certain amount of work from him. He didn't have time to do much more on it, but I did persuade him to put it on the gnome cvs. I worked on it gradually, sending progress reports to the list in case anyone was interested, and so that other people could learn too. After about 4 months I understood what it was doing, and it was able to run simple example code. As soon as I reached that stage lots of people started helping out.
Christian: What are the main design ideas of gtkmm and gnomemm?
Murray: We aim to provide the interface that a skilled C++ coder would expect, based on his experience of the language and the standard C++ Library. We try to use the standard language features wherever possible, just as any sensible C++ coder should. There would be nothing unusual about this if it weren't for bizarre C++ libraries such as QT and MFC. Is sanity really a design decision?
It's not really a design decision, but we are particularly proud that C++ allows us to simplify the underlying C interfaces. For instance, GtkTreeView has a great deal of flexibility, but gtkmm doesn't expect you to worry about that functionality unless you actually want to use it.
Christian: Okay, as you told me you made an effort to get gtkmm going, what where your aims when starting out with it?
Murray: I had 2 aims for gtkmm2:
1) Refactor it until both the interface and the implementation were ridiculously clear. I did not want any lingering doubt about the code just because people couldn't understand it. I believe that even a dull-witted person, with enough time, and enough notepaper, can make sense of anything. If he's not dull-witted then he'll make it easier for the next person.
2) Get more developers involved. This becomes easier after 1) when people can understand the code enough to improve it, but it's also necessary to:
- Present a clear vision so people know what's happening. To this end, I make a point of pre-announcing all major changes, discussing them, and announcing my interpretation of the consensus before proceeding. Everybody now understands that that's how we work, and that's why we've been successful. We only have to point to the list archives to justify our decisions in detail.
- Nurture people to get them started. We do this on the mailing list and in the #c++ IRC channel on irc.gimp.net.
- Let people know that their contributions are valued.
I know from commercial software development that money alone doesn't motivate people. In both proprietary and open-source projects, a team can only succeed if its members feel valued and involved in something worthwhile. That requires constant attention, but it pays off eventually.
Christian: That sounds good, so what is the current status of the C++ bindings for GNOME 2?
Murray: We are approaching API stability for gtkmm2, I think. Our code generator warns us about any functions that we've forgotten to wrap, and we are keeping track of API coverage manually too. We are spending most of our time now perfecting and simplifying the complex TreeView and TextView interfaces, and I see the end in sight there too. Lots of people are using gtkmm2 now and the response is overwhelmingly positive.
gnomemm 2 is progressing more slowly, mostly because it's more difficult for people to install all the latest GNOME 2 libraries. While it's still in development. Gnomemm 2 is much more integrated than gnomemm 1.2 - you can even download and install it as one tarball to get wrappers for libgnomeui, libglade, and gconf, among others.
I recently shared the gtkmm maintainership with Daniel Elstner because he's been doing so much good work on fundamental stuff. With two committed maintainers, and several regular developers, the future should be secure.
Also, we just announced support for the Forte C++ compiler that Sun will use for GNOME 2 on Solaris. And we are on the threshold of supporting Windows. Both of these platforms should be of great interest to commercial in-house developers.
Christian: Do looking ahead, what are the future directions of gtkmm and gnomemm?
Murray: For the future, we need to work on more Rapid Application Development stuff. The idea should be to add convenience without adding complication or straying from existing standards.
I'm working on some libglade additions that should make it easier to link custom code with separately-designed user interfaces. libglademm's syntax is already simpler and more helpful than libglade.
When GNOME's Anjuta2 is released, and when I can easily install KDevelop for KDE3, we need to add helper features for gtkmm.
We need to add things such as:
- Application-creation wizards so people can get started quickly.
- An "Add a signal handler for this widget to this class" feature
- An "Add a member variable for this Glade widget to this container class" feature.
- A widget creation wizard.
- A Bonobo control creation wizard.
- Add a class, deriving from this widget class.
- Add a method to this class.
- Override this method in this class.
Christian: OrbitCpp is being integrated to ship as part of the core ORBit2 package. What will this mean for C++ developers working on GNOME apps?
Murray: The Bonobo bindings are progressing well, but until ORBit2's C++ support is merged in, just after GNOME 2, we must supply bonobomm separately. I'm particularly proud of the Bonobo bindings - the lack of API clarity in Bonobo has long irritated me and this is an opportunity to show that it's not really that difficult. I've explained the issues in more detail elsewhere. C++ is the natural language for CORBA, which is inherently object-orientated - CORBA in C was always a freakish idea so it's no wonder that it's difficult.
So this means more people can use Bonobo. And the API clarity should mean that the Bonobo interfaces receive more scrutiny, because people will understand them well enough to criticize them.
We're really lucky that Michael Meeks decided to support our efforts by merging the C++ mapping into ORBit2 itself. It gives it a mainstream future.
Christian: The release of GNOME 2 is approaching fast now, how does the GNOME 2 platform look from the view of someone producing language bindings for the GNOME platform? Will there be any significant design changes introduced into the bindings due to the changed in the GNOME 2 platform?
Murray: Language bindings should now be much easier. The GTK+ and GNOME authors are more aware of the needs of language bindings and the various bindings are cooperating more, particularly with the
.defs interface-definition files. For instance, we use James Henstridge's .defs generation scripts for pygtk.The transition to GNOME 2 has allowed us to make previously forbidden interface changes to the underlying libraries. We developed gtkmm2 while GTK+ 2 was being developed. With gtkmm 1.2, we just complained about problems in GTK+ 1.2, but this time we fixed the problems in GTK+ as we found them.
gtkmm2 (for GNOME 2) is significantly different than gtkmm 1.2 (for GNOME 1.x). Some of these changes are due to changes in GTK+, but most are just lessons that we learned from gtkmm 1.2. GNOME 2 rationalizes its interfaces a lot by deprecating its more crufty stuff, and we make our interfaces even clearer by omitting those deprecated parts completely.
Christian: What are you favourite applications that has been developed using the gtkmm and gnomemm bindings?
Murray: I use Gabber every day as an instant messenger client - I love how it Just Works. I'm trying to persuade Julian to start the gnomemm2 port, even if I have to code it myself.
Cactus's Guikachu is also pretty impressive - it has made me want to do some Palm development.
There's a bunch of specialist apps out there, though not so many have been ported to gtkmm2 yet. I think that a lot of our users are doing in-house stuff. C++ is much more popular than C for that kind of thing.
I have high hopes for my own Glom app. It's meant to be a very easy-to-use database application that embodies my years of database design experience. But I've been too busy working on gtkmm2/gnomemm2 to port it properly. In the meantime, I released a small file utility, PrefixSuffix, which is a pretty good gtkmm2 example.
Christian: What are your thoughts on the future of the C++ language? Will it continue to be one of the major computer languages or is it set to be replaced by languages such as Java and C#?
Murray: In my opinion, Java and C# are much closer to interpreted languages in their design. By this I mean that much more is decided at runtime than at compile-time. I'm bored by discussions of executable speed, but I do feel that compile-time checking verifies designs and speeds development. Java and C# offer object-orientated improvements over scripting languages such as Perl and Visual Basic, but I see no competitor to C++'s feature set. I expect it to maintain its current high level of popularity.
Christian: About two years ago there was a lot of noise around gtkmm and gnomemm, with Havoc Pennington having started the Inti project, and with the leaving of Guillaume Laurent from gtkmm development, after which Guillaume was quite vocal in why he felt that gtkmm wasn't what thought is should be, in fact he called it a 'throw-away prototype' for a GTK+ C++ wrapper. Two years is a lot of time in the software world so I'm wondering what your thoughts are on the issues debated on back then, and how you see today's versions of gtkmm and gnomemm responding to any real issues raised back then.
Murray: I wasn't involved in those discussions, but I was annoyed at the schism. I like to think that I would have found an acceptable consensus. Most gtkmm users and developers strongly disagreed with Inti's design decisions so we carried on hoping that we would prevail. We did, and Inti didn't, and it's all history now. Inti died because it never involved a community of hackers, whereas I like to think that people preferred to work on gtkmm's design and felt more welcome in the gtkmm community.
RedHat's whole Inti framework never made much sense to people. Havoc is such a pragmatic developer that I still don't believe it was really his brainchild.
But Inti did create confusion among users, and even prompted one of the gtkmm maintainers to give up. My guess is that Guillaume never really got a handle on the gtkmm codebase and took the opportunity to jump clear of something that daunted him. When I was building gtkmm2 I sometimes felt the same but I chose instead to radically refactor it until it was manageable. I believe Guillaume felt certain anyway that, with RedHat's backing, Inti would succeed and gtkmm would fade away.
Guillaume uses QT now. He has stated that it was more important for him to have a full working toolkit than a perfect API. gtkmm2 will go stable soon - then we will have both in one toolkit.
Christian: What are the main differences of coding with gtkmm and gnomemm compared to coding with QT and KDE?
Murray: I addressed this in my GUADEC talk (1) and (2).
Basically, QT isn't developed publicly so it makes a number of mistakes without the benefit of any real criticism. Chief among these is its modification of the C++ language and the use of its own non-standard string class. It isn't necessary, as we've proved. These are just two ways that we've kept more up-to-date with the state-of-the-art in C++. It's then easier to use gtkmm in combination with other C++ APIs. I believe that you'll love gtkmm if you love C++, and that gtkmm is a better role-model if you're learning C++.
People sometimes complain about a lack of gtkmm documentation compared to QT, but that hasn't been true for a long time(*).
And perhaps most importantly, if you find a problem with gtkmm you can submit a patch or discuss it with the developers.
Christian: What is the advantage of using the bindings when creating GNOME and GTK+ applications in C++ compared to just accessing the C widgets?
Murray: Again, the GUADEC talk mentioned this (1) and (2).
gtkmm applications tends to be more organized than GTK+ programs. That's mostly because it's laughably easy for us to derive new widgets just to organise our code. In comparison, the structure of GTK+ code tends to be defined by the path that data happens to take through the code, rather than the layout of the source code itself.
Christian: What would you say to a developer who is trying to decide whether to write his application in C or whether to use gtkmm and gnomemm and C++?
Murray: I believe it's easier to develop software with C++, even if you're not very experienced, because the structure is there in the code, not just in your head. If you're as good as the GTK+/GNOME developers then maybe you can deal with the underlying C interfaces, but, in my experience, most coders want an easier life.
I'd recommend that people compare the C and C++ versions of the examples before deciding.
Christian: You made a presentation at GUADEC 3 this year. What is your impression of the GNOME community, is it becoming more language agnostic or is there still a strong favouring of C among the hackers you talked too?
Murray: I think people accept now that there will always be active language bindings for GNOME, and many of the core hackers now routinely use more than one programming language. There is still some general Unix-style dislike of C++, but interest has grown as people have seen that gtkmm is very much alive and useful.
Christian: For anyone wanting to learn how to create applications using gtkmm and gnomemm, where should they start looking? Are there any applications out there that you think a newbie would find a easy starting point to look at before starting creating their own applications?
Murray: Assuming that you're already a C++ coder, you should be able to get started easily by looking at the examples and the 'Programming with gtkmm' book. In fact, we have a particularly good documentation overview page with quick links into the manual and the reference documentation: http://www.gtkmm.org/gtkmm2/
We have converted all of the GTK+ examples and demos and added some of our own. I believe it's easier for a C++ coder to understand the gtkmm examples than it is for a C coder to understand the GTK+ examples.
I strongly suggest that you start with gtkmm2 rather than the stable gtkmm 1.2, because we have obliterated several confusing things.
People should also join the gtkmm-main mailing list and the #c++ channel on irc.gnome.org. We are a helpful bunch.
Christian: Okay, thanks for taking the time to talk with me Murray.
Murray: No problem, it was a pleasure.
-
Slashdotted already!Interview by Christian Fredrik Kalager Schaller
If you have followed GNU/Linux for the last few years you know that GNOME has long been a stronghold of C, Perl and Python GUI programming. With Ximian's work on Mono, C# seems also to be a language that will see wide use in GNOME. Sun's involvement should also make Java applications integrate strongly with GNOME. But what about C++? Even in the GNU/Linux and Unix world this language has received many advocates and developers. I sat down with Murray Cumming, lead developer on the gtkmm and gnomemm C++ bindings for GTK+ and GNOME to get some information on the status of C++ development in GNOME.
Christian: What is your background and what puts food on your table in real life?
Murray: I'm a freelance developer, though that's difficult in the current market. I do C++ development on Unix, on all kinds of projects, such as protocol implementations, compilers, interpreters, data converters, management systems, and GUIs to make sense of all these. I've lived in Munich, Germany, for the past 3 years, but I'm officially a Brit. I love Munich's healthy outdoors lifestyle and easy-going socialising. I try to put the Lederhosen out of my mind.
Over the past ten years I worked my way up through paper-shuffling, data-entry, typography/design, tech-support, database consultancy, and Windows development. I didn't learn programming at a college, and I still stubbornly believe that it made me a better developer. You have to really care about something to teach yourself in your spare time.
I didn't use any Unix-like systems until Linux was widely available. People forget that before Linux you had to go to University to use Unix. Some companies had big Unix boxes, and the staff who used them generally earned huge sums because they knew how to move files around. Naturally they didn't let anyone else near them.
I've grown to love the control that Unix gives you but I've done hardcore GUI development on MacOS and Windows, so I know there's more to life. Unlike lots of GNOME developers, I know that the Mac is a worthy influence but that Windows gives us nothing to chase.
Christian: How did you get involved in developing gtkmm and gnomemm?
Murray: I was originally just a user, more attracted to the up-to-date gtkmm than the awkward (and then non-free) QT. I did the carthorse work necessary to get gnomemm 1.2 usable and stable, and that's how I learned about the general issues involved.
Then I decided to make a big effort to get gtkmm2 going, when it didn't look like anyone else was going to do it. Karl had the beginnings of gtkmm2, but it didn't build and he was reluctant to show it to the world, fearing that people would expect a certain amount of work from him. He didn't have time to do much more on it, but I did persuade him to put it on the gnome cvs. I worked on it gradually, sending progress reports to the list in case anyone was interested, and so that other people could learn too. After about 4 months I understood what it was doing, and it was able to run simple example code. As soon as I reached that stage lots of people started helping out.
Christian: What are the main design ideas of gtkmm and gnomemm?
Murray: We aim to provide the interface that a skilled C++ coder would expect, based on his experience of the language and the standard C++ Library. We try to use the standard language features wherever possible, just as any sensible C++ coder should. There would be nothing unusual about this if it weren't for bizarre C++ libraries such as QT and MFC. Is sanity really a design decision?
It's not really a design decision, but we are particularly proud that C++ allows us to simplify the underlying C interfaces. For instance, GtkTreeView has a great deal of flexibility, but gtkmm doesn't expect you to worry about that functionality unless you actually want to use it.
Christian: Okay, as you told me you made an effort to get gtkmm going, what where your aims when starting out with it?
Murray: I had 2 aims for gtkmm2:
1) Refactor it until both the interface and the implementation were ridiculously clear. I did not want any lingering doubt about the code just because people couldn't understand it. I believe that even a dull-witted person, with enough time, and enough notepaper, can make sense of anything. If he's not dull-witted then he'll make it easier for the next person.
2) Get more developers involved. This becomes easier after 1) when people can understand the code enough to improve it, but it's also necessary to:
- Present a clear vision so people know what's happening. To this end, I make a point of pre-announcing all major changes, discussing them, and announcing my interpretation of the consensus before proceeding. Everybody now understands that that's how we work, and that's why we've been successful. We only have to point to the list archives to justify our decisions in detail.
- Nurture people to get them started. We do this on the mailing list and in the #c++ IRC channel on irc.gimp.net.
- Let people know that their contributions are valued.
I know from commercial software development that money alone doesn't motivate people. In both proprietary and open-source projects, a team can only succeed if its members feel valued and involved in something worthwhile. That requires constant attention, but it pays off eventually.
Christian: That sounds good, so what is the current status of the C++ bindings for GNOME 2?
Murray: We are approaching API stability for gtkmm2, I think. Our code generator warns us about any functions that we've forgotten to wrap, and we are keeping track of API coverage manually too. We are spending most of our time now perfecting and simplifying the complex TreeView and TextView interfaces, and I see the end in sight there too. Lots of people are using gtkmm2 now and the response is overwhelmingly positive.
gnomemm 2 is progressing more slowly, mostly because it's more difficult for people to install all the latest GNOME 2 libraries. While it's still in development. Gnomemm 2 is much more integrated than gnomemm 1.2 - you can even download and install it as one tarball to get wrappers for libgnomeui, libglade, and gconf, among others.
I recently shared the gtkmm maintainership with Daniel Elstner because he's been doing so much good work on fundamental stuff. With two committed maintainers, and several regular developers, the future should be secure.
Also, we just announced support for the Forte C++ compiler that Sun will use for GNOME 2 on Solaris. And we are on the threshold of supporting Windows. Both of these platforms should be of great interest to commercial in-house developers.
Christian: Do looking ahead, what are the future directions of gtkmm and gnomemm?
Murray: For the future, we need to work on more Rapid Application Development stuff. The idea should be to add convenience without adding complication or straying from existing standards.
I'm working on some libglade additions that should make it easier to link custom code with separately-designed user interfaces. libglademm's syntax is already simpler and more helpful than libglade.
When GNOME's Anjuta2 is released, and when I can easily install KDevelop for KDE3, we need to add helper features for gtkmm.
We need to add things such as:
- Application-creation wizards so people can get started quickly.
- An "Add a signal handler for this widget to this class" feature
- An "Add a member variable for this Glade widget to this container class" feature.
- A widget creation wizard.
- A Bonobo control creation wizard.
- Add a class, deriving from this widget class.
- Add a method to this class.
- Override this method in this class.
Christian: OrbitCpp is being integrated to ship as part of the core ORBit2 package. What will this mean for C++ developers working on GNOME apps?
Murray: The Bonobo bindings are progressing well, but until ORBit2's C++ support is merged in, just after GNOME 2, we must supply bonobomm separately. I'm particularly proud of the Bonobo bindings - the lack of API clarity in Bonobo has long irritated me and this is an opportunity to show that it's not really that difficult. I've explained the issues in more detail elsewhere. C++ is the natural language for CORBA, which is inherently object-orientated - CORBA in C was always a freakish idea so it's no wonder that it's difficult.
So this means more people can use Bonobo. And the API clarity should mean that the Bonobo interfaces receive more scrutiny, because people will understand them well enough to criticize them.
We're really lucky that Michael Meeks decided to support our efforts by merging the C++ mapping into ORBit2 itself. It gives it a mainstream future.
Christian: The release of GNOME 2 is approaching fast now, how does the GNOME 2 platform look from the view of someone producing language bindings for the GNOME platform? Will there be any significant design changes introduced into the bindings due to the changed in the GNOME 2 platform?
Murray: Language bindings should now be much easier. The GTK+ and GNOME authors are more aware of the needs of language bindings and the various bindings are cooperating more, particularly with the
.defs interface-definition files. For instance, we use James Henstridge's .defs generation scripts for pygtk.The transition to GNOME 2 has allowed us to make previously forbidden interface changes to the underlying libraries. We developed gtkmm2 while GTK+ 2 was being developed. With gtkmm 1.2, we just complained about problems in GTK+ 1.2, but this time we fixed the problems in GTK+ as we found them.
gtkmm2 (for GNOME 2) is significantly different than gtkmm 1.2 (for GNOME 1.x). Some of these changes are due to changes in GTK+, but most are just lessons that we learned from gtkmm 1.2. GNOME 2 rationalizes its interfaces a lot by deprecating its more crufty stuff, and we make our interfaces even clearer by omitting those deprecated parts completely.
Christian: What are you favourite applications that has been developed using the gtkmm and gnomemm bindings?
Murray: I use Gabber every day as an instant messenger client - I love how it Just Works. I'm trying to persuade Julian to start the gnomemm2 port, even if I have to code it myself.
Cactus's Guikachu is also pretty impressive - it has made me want to do some Palm development.
There's a bunch of specialist apps out there, though not so many have been ported to gtkmm2 yet. I think that a lot of our users are doing in-house stuff. C++ is much more popular than C for that kind of thing.
I have high hopes for my own Glom app. It's meant to be a very easy-to-use database application that embodies my years of database design experience. But I've been too busy working on gtkmm2/gnomemm2 to port it properly. In the meantime, I released a small file utility, PrefixSuffix, which is a pretty good gtkmm2 example.
Christian: What are your thoughts on the future of the C++ language? Will it continue to be one of the major computer languages or is it set to be replaced by languages such as Java and C#?
Murray: In my opinion, Java and C# are much closer to interpreted languages in their design. By this I mean that much more is decided at runtime than at compile-time. I'm bored by discussions of executable speed, but I do feel that compile-time checking verifies designs and speeds development. Java and C# offer object-orientated improvements over scripting languages such as Perl and Visual Basic, but I see no competitor to C++'s feature set. I expect it to maintain its current high level of popularity.
Christian: About two years ago there was a lot of noise around gtkmm and gnomemm, with Havoc Pennington having started the Inti project, and with the leaving of Guillaume Laurent from gtkmm development, after which Guillaume was quite vocal in why he felt that gtkmm wasn't what thought is should be, in fact he called it a 'throw-away prototype' for a GTK+ C++ wrapper. Two years is a lot of time in the software world so I'm wondering what your thoughts are on the issues debated on back then, and how you see today's versions of gtkmm and gnomemm responding to any real issues raised back then.
Murray: I wasn't involved in those discussions, but I was annoyed at the schism. I like to think that I would have found an acceptable consensus. Most gtkmm users and developers strongly disagreed with Inti's design decisions so we carried on hoping that we would prevail. We did, and Inti didn't, and it's all history now. Inti died because it never involved a community of hackers, whereas I like to think that people preferred to work on gtkmm's design and felt more welcome in the gtkmm community.
RedHat's whole Inti framework never made much sense to people. Havoc is such a pragmatic developer that I still don't believe it was really his brainchild.
But Inti did create confusion among users, and even prompted one of the gtkmm maintainers to give up. My guess is that Guillaume never really got a handle on the gtkmm codebase and took the opportunity to jump clear of something that daunted him. When I was building gtkmm2 I sometimes felt the same but I chose instead to radically refactor it until it was manageable. I believe Guillaume felt certain anyway that, with RedHat's backing, Inti would succeed and gtkmm would fade away.
Guillaume uses QT now. He has stated that it was more important for him to have a full working toolkit than a perfect API. gtkmm2 will go stable soon - then we will have both in one toolkit.
Christian: What are the main differences of coding with gtkmm and gnomemm compared to coding with QT and KDE?
Murray: I addressed this in my GUADEC talk (1) and (2).
Basically, QT isn't developed publicly so it makes a number of mistakes without the benefit of any real criticism. Chief among these is its modification of the C++ language and the use of its own non-standard string class. It isn't necessary, as we've proved. These are just two ways that we've kept more up-to-date with the state-of-the-art in C++. It's then easier to use gtkmm in combination with other C++ APIs. I believe that you'll love gtkmm if you love C++, and that gtkmm is a better role-model if you're learning C++.
People sometimes complain about a lack of gtkmm documentation compared to QT, but that hasn't been true for a long time(*).
And perhaps most importantly, if you find a problem with gtkmm you can submit a patch or discuss it with the developers.
Christian: What is the advantage of using the bindings when creating GNOME and GTK+ applications in C++ compared to just accessing the C widgets?
Murray: Again, the GUADEC talk mentioned this (1) and (2).
gtkmm applications tends to be more organized than GTK+ programs. That's mostly because it's laughably easy for us to derive new widgets just to organise our code. In comparison, the structure of GTK+ code tends to be defined by the path that data happens to take through the code, rather than the layout of the source code itself.
Christian: What would you say to a developer who is trying to decide whether to write his application in C or whether to use gtkmm and gnomemm and C++?
Murray: I believe it's easier to develop software with C++, even if you're not very experienced, because the structure is there in the code, not just in your head. If you're as good as the GTK+/GNOME developers then maybe you can deal with the underlying C interfaces, but, in my experience, most coders want an easier life.
I'd recommend that people compare the C and C++ versions of the examples before deciding.
Christian: You made a presentation at GUADEC 3 this year. What is your impression of the GNOME community, is it becoming more language agnostic or is there still a strong favouring of C among the hackers you talked too?
Murray: I think people accept now that there will always be active language bindings for GNOME, and many of the core hackers now routinely use more than one programming language. There is still some general Unix-style dislike of C++, but interest has grown as people have seen that gtkmm is very much alive and useful.
Christian: For anyone wanting to learn how to create applications using gtkmm and gnomemm, where should they start looking? Are there any applications out there that you think a newbie would find a easy starting point to look at before starting creating their own applications?
Murray: Assuming that you're already a C++ coder, you should be able to get started easily by looking at the examples and the 'Programming with gtkmm' book. In fact, we have a particularly good documentation overview page with quick links into the manual and the reference documentation: http://www.gtkmm.org/gtkmm2/
We have converted all of the GTK+ examples and demos and added some of our own. I believe it's easier for a C++ coder to understand the gtkmm examples than it is for a C coder to understand the GTK+ examples.
I strongly suggest that you start with gtkmm2 rather than the stable gtkmm 1.2, because we have obliterated several confusing things.
People should also join the gtkmm-main mailing list and the #c++ channel on irc.gnome.org. We are a helpful bunch.
Christian: Okay, thanks for taking the time to talk with me Murray.
Murray: No problem, it was a pleasure.
-
Slashdotted already!Interview by Christian Fredrik Kalager Schaller
If you have followed GNU/Linux for the last few years you know that GNOME has long been a stronghold of C, Perl and Python GUI programming. With Ximian's work on Mono, C# seems also to be a language that will see wide use in GNOME. Sun's involvement should also make Java applications integrate strongly with GNOME. But what about C++? Even in the GNU/Linux and Unix world this language has received many advocates and developers. I sat down with Murray Cumming, lead developer on the gtkmm and gnomemm C++ bindings for GTK+ and GNOME to get some information on the status of C++ development in GNOME.
Christian: What is your background and what puts food on your table in real life?
Murray: I'm a freelance developer, though that's difficult in the current market. I do C++ development on Unix, on all kinds of projects, such as protocol implementations, compilers, interpreters, data converters, management systems, and GUIs to make sense of all these. I've lived in Munich, Germany, for the past 3 years, but I'm officially a Brit. I love Munich's healthy outdoors lifestyle and easy-going socialising. I try to put the Lederhosen out of my mind.
Over the past ten years I worked my way up through paper-shuffling, data-entry, typography/design, tech-support, database consultancy, and Windows development. I didn't learn programming at a college, and I still stubbornly believe that it made me a better developer. You have to really care about something to teach yourself in your spare time.
I didn't use any Unix-like systems until Linux was widely available. People forget that before Linux you had to go to University to use Unix. Some companies had big Unix boxes, and the staff who used them generally earned huge sums because they knew how to move files around. Naturally they didn't let anyone else near them.
I've grown to love the control that Unix gives you but I've done hardcore GUI development on MacOS and Windows, so I know there's more to life. Unlike lots of GNOME developers, I know that the Mac is a worthy influence but that Windows gives us nothing to chase.
Christian: How did you get involved in developing gtkmm and gnomemm?
Murray: I was originally just a user, more attracted to the up-to-date gtkmm than the awkward (and then non-free) QT. I did the carthorse work necessary to get gnomemm 1.2 usable and stable, and that's how I learned about the general issues involved.
Then I decided to make a big effort to get gtkmm2 going, when it didn't look like anyone else was going to do it. Karl had the beginnings of gtkmm2, but it didn't build and he was reluctant to show it to the world, fearing that people would expect a certain amount of work from him. He didn't have time to do much more on it, but I did persuade him to put it on the gnome cvs. I worked on it gradually, sending progress reports to the list in case anyone was interested, and so that other people could learn too. After about 4 months I understood what it was doing, and it was able to run simple example code. As soon as I reached that stage lots of people started helping out.
Christian: What are the main design ideas of gtkmm and gnomemm?
Murray: We aim to provide the interface that a skilled C++ coder would expect, based on his experience of the language and the standard C++ Library. We try to use the standard language features wherever possible, just as any sensible C++ coder should. There would be nothing unusual about this if it weren't for bizarre C++ libraries such as QT and MFC. Is sanity really a design decision?
It's not really a design decision, but we are particularly proud that C++ allows us to simplify the underlying C interfaces. For instance, GtkTreeView has a great deal of flexibility, but gtkmm doesn't expect you to worry about that functionality unless you actually want to use it.
Christian: Okay, as you told me you made an effort to get gtkmm going, what where your aims when starting out with it?
Murray: I had 2 aims for gtkmm2:
1) Refactor it until both the interface and the implementation were ridiculously clear. I did not want any lingering doubt about the code just because people couldn't understand it. I believe that even a dull-witted person, with enough time, and enough notepaper, can make sense of anything. If he's not dull-witted then he'll make it easier for the next person.
2) Get more developers involved. This becomes easier after 1) when people can understand the code enough to improve it, but it's also necessary to:
- Present a clear vision so people know what's happening. To this end, I make a point of pre-announcing all major changes, discussing them, and announcing my interpretation of the consensus before proceeding. Everybody now understands that that's how we work, and that's why we've been successful. We only have to point to the list archives to justify our decisions in detail.
- Nurture people to get them started. We do this on the mailing list and in the #c++ IRC channel on irc.gimp.net.
- Let people know that their contributions are valued.
I know from commercial software development that money alone doesn't motivate people. In both proprietary and open-source projects, a team can only succeed if its members feel valued and involved in something worthwhile. That requires constant attention, but it pays off eventually.
Christian: That sounds good, so what is the current status of the C++ bindings for GNOME 2?
Murray: We are approaching API stability for gtkmm2, I think. Our code generator warns us about any functions that we've forgotten to wrap, and we are keeping track of API coverage manually too. We are spending most of our time now perfecting and simplifying the complex TreeView and TextView interfaces, and I see the end in sight there too. Lots of people are using gtkmm2 now and the response is overwhelmingly positive.
gnomemm 2 is progressing more slowly, mostly because it's more difficult for people to install all the latest GNOME 2 libraries. While it's still in development. Gnomemm 2 is much more integrated than gnomemm 1.2 - you can even download and install it as one tarball to get wrappers for libgnomeui, libglade, and gconf, among others.
I recently shared the gtkmm maintainership with Daniel Elstner because he's been doing so much good work on fundamental stuff. With two committed maintainers, and several regular developers, the future should be secure.
Also, we just announced support for the Forte C++ compiler that Sun will use for GNOME 2 on Solaris. And we are on the threshold of supporting Windows. Both of these platforms should be of great interest to commercial in-house developers.
Christian: Do looking ahead, what are the future directions of gtkmm and gnomemm?
Murray: For the future, we need to work on more Rapid Application Development stuff. The idea should be to add convenience without adding complication or straying from existing standards.
I'm working on some libglade additions that should make it easier to link custom code with separately-designed user interfaces. libglademm's syntax is already simpler and more helpful than libglade.
When GNOME's Anjuta2 is released, and when I can easily install KDevelop for KDE3, we need to add helper features for gtkmm.
We need to add things such as:
- Application-creation wizards so people can get started quickly.
- An "Add a signal handler for this widget to this class" feature
- An "Add a member variable for this Glade widget to this container class" feature.
- A widget creation wizard.
- A Bonobo control creation wizard.
- Add a class, deriving from this widget class.
- Add a method to this class.
- Override this method in this class.
Christian: OrbitCpp is being integrated to ship as part of the core ORBit2 package. What will this mean for C++ developers working on GNOME apps?
Murray: The Bonobo bindings are progressing well, but until ORBit2's C++ support is merged in, just after GNOME 2, we must supply bonobomm separately. I'm particularly proud of the Bonobo bindings - the lack of API clarity in Bonobo has long irritated me and this is an opportunity to show that it's not really that difficult. I've explained the issues in more detail elsewhere. C++ is the natural language for CORBA, which is inherently object-orientated - CORBA in C was always a freakish idea so it's no wonder that it's difficult.
So this means more people can use Bonobo. And the API clarity should mean that the Bonobo interfaces receive more scrutiny, because people will understand them well enough to criticize them.
We're really lucky that Michael Meeks decided to support our efforts by merging the C++ mapping into ORBit2 itself. It gives it a mainstream future.
Christian: The release of GNOME 2 is approaching fast now, how does the GNOME 2 platform look from the view of someone producing language bindings for the GNOME platform? Will there be any significant design changes introduced into the bindings due to the changed in the GNOME 2 platform?
Murray: Language bindings should now be much easier. The GTK+ and GNOME authors are more aware of the needs of language bindings and the various bindings are cooperating more, particularly with the
.defs interface-definition files. For instance, we use James Henstridge's .defs generation scripts for pygtk.The transition to GNOME 2 has allowed us to make previously forbidden interface changes to the underlying libraries. We developed gtkmm2 while GTK+ 2 was being developed. With gtkmm 1.2, we just complained about problems in GTK+ 1.2, but this time we fixed the problems in GTK+ as we found them.
gtkmm2 (for GNOME 2) is significantly different than gtkmm 1.2 (for GNOME 1.x). Some of these changes are due to changes in GTK+, but most are just lessons that we learned from gtkmm 1.2. GNOME 2 rationalizes its interfaces a lot by deprecating its more crufty stuff, and we make our interfaces even clearer by omitting those deprecated parts completely.
Christian: What are you favourite applications that has been developed using the gtkmm and gnomemm bindings?
Murray: I use Gabber every day as an instant messenger client - I love how it Just Works. I'm trying to persuade Julian to start the gnomemm2 port, even if I have to code it myself.
Cactus's Guikachu is also pretty impressive - it has made me want to do some Palm development.
There's a bunch of specialist apps out there, though not so many have been ported to gtkmm2 yet. I think that a lot of our users are doing in-house stuff. C++ is much more popular than C for that kind of thing.
I have high hopes for my own Glom app. It's meant to be a very easy-to-use database application that embodies my years of database design experience. But I've been too busy working on gtkmm2/gnomemm2 to port it properly. In the meantime, I released a small file utility, PrefixSuffix, which is a pretty good gtkmm2 example.
Christian: What are your thoughts on the future of the C++ language? Will it continue to be one of the major computer languages or is it set to be replaced by languages such as Java and C#?
Murray: In my opinion, Java and C# are much closer to interpreted languages in their design. By this I mean that much more is decided at runtime than at compile-time. I'm bored by discussions of executable speed, but I do feel that compile-time checking verifies designs and speeds development. Java and C# offer object-orientated improvements over scripting languages such as Perl and Visual Basic, but I see no competitor to C++'s feature set. I expect it to maintain its current high level of popularity.
Christian: About two years ago there was a lot of noise around gtkmm and gnomemm, with Havoc Pennington having started the Inti project, and with the leaving of Guillaume Laurent from gtkmm development, after which Guillaume was quite vocal in why he felt that gtkmm wasn't what thought is should be, in fact he called it a 'throw-away prototype' for a GTK+ C++ wrapper. Two years is a lot of time in the software world so I'm wondering what your thoughts are on the issues debated on back then, and how you see today's versions of gtkmm and gnomemm responding to any real issues raised back then.
Murray: I wasn't involved in those discussions, but I was annoyed at the schism. I like to think that I would have found an acceptable consensus. Most gtkmm users and developers strongly disagreed with Inti's design decisions so we carried on hoping that we would prevail. We did, and Inti didn't, and it's all history now. Inti died because it never involved a community of hackers, whereas I like to think that people preferred to work on gtkmm's design and felt more welcome in the gtkmm community.
RedHat's whole Inti framework never made much sense to people. Havoc is such a pragmatic developer that I still don't believe it was really his brainchild.
But Inti did create confusion among users, and even prompted one of the gtkmm maintainers to give up. My guess is that Guillaume never really got a handle on the gtkmm codebase and took the opportunity to jump clear of something that daunted him. When I was building gtkmm2 I sometimes felt the same but I chose instead to radically refactor it until it was manageable. I believe Guillaume felt certain anyway that, with RedHat's backing, Inti would succeed and gtkmm would fade away.
Guillaume uses QT now. He has stated that it was more important for him to have a full working toolkit than a perfect API. gtkmm2 will go stable soon - then we will have both in one toolkit.
Christian: What are the main differences of coding with gtkmm and gnomemm compared to coding with QT and KDE?
Murray: I addressed this in my GUADEC talk (1) and (2).
Basically, QT isn't developed publicly so it makes a number of mistakes without the benefit of any real criticism. Chief among these is its modification of the C++ language and the use of its own non-standard string class. It isn't necessary, as we've proved. These are just two ways that we've kept more up-to-date with the state-of-the-art in C++. It's then easier to use gtkmm in combination with other C++ APIs. I believe that you'll love gtkmm if you love C++, and that gtkmm is a better role-model if you're learning C++.
People sometimes complain about a lack of gtkmm documentation compared to QT, but that hasn't been true for a long time(*).
And perhaps most importantly, if you find a problem with gtkmm you can submit a patch or discuss it with the developers.
Christian: What is the advantage of using the bindings when creating GNOME and GTK+ applications in C++ compared to just accessing the C widgets?
Murray: Again, the GUADEC talk mentioned this (1) and (2).
gtkmm applications tends to be more organized than GTK+ programs. That's mostly because it's laughably easy for us to derive new widgets just to organise our code. In comparison, the structure of GTK+ code tends to be defined by the path that data happens to take through the code, rather than the layout of the source code itself.
Christian: What would you say to a developer who is trying to decide whether to write his application in C or whether to use gtkmm and gnomemm and C++?
Murray: I believe it's easier to develop software with C++, even if you're not very experienced, because the structure is there in the code, not just in your head. If you're as good as the GTK+/GNOME developers then maybe you can deal with the underlying C interfaces, but, in my experience, most coders want an easier life.
I'd recommend that people compare the C and C++ versions of the examples before deciding.
Christian: You made a presentation at GUADEC 3 this year. What is your impression of the GNOME community, is it becoming more language agnostic or is there still a strong favouring of C among the hackers you talked too?
Murray: I think people accept now that there will always be active language bindings for GNOME, and many of the core hackers now routinely use more than one programming language. There is still some general Unix-style dislike of C++, but interest has grown as people have seen that gtkmm is very much alive and useful.
Christian: For anyone wanting to learn how to create applications using gtkmm and gnomemm, where should they start looking? Are there any applications out there that you think a newbie would find a easy starting point to look at before starting creating their own applications?
Murray: Assuming that you're already a C++ coder, you should be able to get started easily by looking at the examples and the 'Programming with gtkmm' book. In fact, we have a particularly good documentation overview page with quick links into the manual and the reference documentation: http://www.gtkmm.org/gtkmm2/
We have converted all of the GTK+ examples and demos and added some of our own. I believe it's easier for a C++ coder to understand the gtkmm examples than it is for a C coder to understand the GTK+ examples.
I strongly suggest that you start with gtkmm2 rather than the stable gtkmm 1.2, because we have obliterated several confusing things.
People should also join the gtkmm-main mailing list and the #c++ channel on irc.gnome.org. We are a helpful bunch.
Christian: Okay, thanks for taking the time to talk with me Murray.
Murray: No problem, it was a pleasure.