Hi,
Ehsan Akhgari wrote: > I'm looking forward to have your ideas about a portable C++ GUI library, > which can be used to write a single code base for both Linux and Windows. > The ones I've seen that claim to do it are GTK+, Well you can use either C gtk+ or gtkmm, the C++ bindings. Gtk in itself is a good toolkit imo, flexible and intuitive to use. Its documentation is better than it was 2 years ago, but still not up to the same level of msdn. Expect to look at other people's source code a lot. Gtkmm is the C++ binding to gtk+, and it's pretty good. Very STL'ish (but has a utf8 string class too, damn you std::string!) and straighforward to use. Documentation is there but not great, but combined with the C documentation, other sourcecode and the mailing lists it's workable. Now for the bad part: gtk was writting for X and it shows. The windows port is a hack and hardly anyone uses it for cross-platform development; most windows gtk programs were writting for unix and the windows port is just a side-effect. It's hard to get programs on windows to look like native windows programs and it's almost impossible to get them to look good. One example is the icons; their style is very different on windows and linux. Download gaim (gaim.sf.net) to see what I mean. Don't get me wrong, it's a great program and I use it every day (on windows) but it doesn't look 'polished'. Gtk has, besides the gui toolkit, some other goodies; the c version has linked lists and hashtables and similar data structures in glib but they are alreay in stl of course for the c++ version. Both the c and c++ versions have a signalling system, cross-platform thread abstraction and string handling classes. That's about it of the top of my head; stuff like xml handling or networking are in separate libraries. > Qt, Qt is good but non-free (for windows). 3000 USD is not much for a commercial program but hefty for hobby development. It's fairly clean by 1995 standards but not by today's; that may or may not bother you. For example the signals system is a klugde compared to that of gtkmm; you have to preprocess all files with a program called moc to get a signals and rtti system. On the upside, it's very well documented and widely used so it's easy to get example code. Qt isn't just gui code: it has classes for all sorts of other stuff like internationalization, xml handling, database connectivity, anything you could possibly need. That makes it very complete and also very easy to maintain a development environment for: just update Qt and you have new versions of everything. To summarize: I'd recommend it over all alternatives but only for commercial development where the windows version is important (like in: the unix and windows versions are values equally). > and wxWindows. First, it's not called wxWindows anymore, it's wxWidgets nowadays. That being said, for people who are used to MFC it will feel familiar, for all others it will feel awkward. Lots of macros everywhere which doesn't help transparancy. Documentation is good though, and it doesn't just have gui stuff, but also database support and multithreading. I haven't seen any applications that have been written with it yet that look good. It's hard to get it just right; things like spacing and widget placement are near impossible to get consistently good-looking on both platforms. Part of the platform is the inherent difference between the ways widgets are placed on windows and gtk (wxWidgets uses gtk on Linux); fixed placing on windows vs layout-based on gtk. My recommendation: it's free, it works, and it's fairly easy to use, but that's it. Applications written with it just scream 'hobby project' imo. A toolkit you haven't mentioned is vcf (vcf.sf.net) but it's very incomplete and I don't know of any software using it. Just thought I'd mention it for completeness. > Have any of you guys have experienced any of these? Any > recommendations, or points you'd like to warn me about? You didn't mention the license you'll be releasing your app under, that is very relevant, too. And I assume you'll only be using C/C++, but maybe it would be interesting to have a look at other language bindings too and then connect that to your C/C++ backend. For example, both gtk and wxWidgets have very good Python bindings and it's very easy to call Python from C++ with the boost python bindings. Another option would be to forget about the 'native' look and write the whole gui in html. Symantec Antivirus has an html gui that looks great imo. Then write a small wrapper around mozilla and use that on both platforms. Or just write it all in XUL. Big disadvantage is the dependency on Mozilla (or the huge download if you include it in your installer). > The most important requirement is an application developed using it > compiles and runs fine in both Linux and Windows, with minimal platform > specific code between the two. If there's no C++ API, but only a C > API, then that's fine. Yeah I'd like that too, but it's not gonna happen soon, sorry :) I'll tell you what I do nowadays: I make a strict separation between gui and backend code and I write two gui frontends, one for windows with wtl and one for linux with gtkmm. It's more work but you can give your gui's all those extra little thing that make it integrate with the os that you can never do with cross-platform toolkits and that provide that 'complete user experience'. Sorry for the disencouragement :) cheers, roel > Of course, I prefer the library doesn't look awkward in one of these two > platforms. A native look and feel in both would be ideal. > > Thanks in advance, > ------------- > Ehsan Akhgari > > Farda Technology (http://www.farda-tech.com/) > > List Owner: [EMAIL PROTECTED] > > [ Email: [EMAIL PROTECTED] ] > [ WWW: http://www.beginthread.com/Ehsan ] > > The answers to life's questions lie inside you. All you need to do is look, > listen, and trust. > > > > > _______________________________________________ > msvc mailing list > [EMAIL PROTECTED] > See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for > subscription changes, and list archive. > _______________________________________________ msvc mailing list [EMAIL PROTECTED] See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for subscription changes, and list archive.
