Cross-Platform GUI application development: seeking advice

KevinMU1

Senior member
Sep 23, 2001
673
0
0
I'm probably asking for the world's programmers' panacea / utopia here, but I have to ask.

I am interested in doing cross-platform GUI development, especially between Windows and Unix/linux. Mac OS is a bonus, although I understand that OS X can run unix/linux apps. Free IDE and Tools very much preferred, but not required.

Preferred language is C++, but not required. JIT solutions like Java are definitely not preferred, a compiler-based language is strongly preferred.

I am aware of the following solutions, and will briefly describe why each is not "ideal" in my mind:

1) Delphi/Kylix: Delphi is not free, even though Open Kylix is. Cost factor here is not appealing. Same with C++Builder.
2) wxWindows: very nice tool, except that we don't get an IDE, only a sort of AWT that allows platform independent GUI creation.
3) devC++: Only seems to be substantial support in Windows, I see a linux version but it hasn't been updated in a year and a half
4) Python: I understand wxPython can be combined with Python to develop cross-platform GUIs, but there seems to be a lack of good tools. Maybe I just didn't find them.

It seems that I can find pieces of what I want, but not a good solution. I read about a program being compiled in Windows on Delphi, and the same program then compiled and run on Kylix, but the cost factor there is unappealing. Is there anything open source or GNU that is available like Kylix/Delphi.

Short of a complete solution, are there a couple of easy pieces that can be put together or both sides of the fence that would allow for easy cross-platform development? I am willing to put time in to learn new things, I just don't want to have totally separate tools on each side, and the more integration/similarity that I can have, the better. I would even be willing to learn a new language if it was worthwhile.

Any advice, guidance, suggestions, wisdom, preaching, etc are greatly appreciated. I am very explorative and very much just trying to get as much information as I can about what is available.

Thanks in advance.
 

singh

Golden Member
Jul 5, 2001
1,449
0
0
JAVA is by far the best choice at the moment (even though I too dislike it quite strongly).
 

Armitage

Banned
Feb 23, 2001
8,086
0
0
Qt is very good in Linux, I imagine the windows version is comparable. It has a nice gui design application as well.
Not free though, unless you are doing open-source development for Linux.
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
What kind of application are you wanting to build? Is this for your BitWise chat?

If you want true platform independence, you're going to have to make sacrifices. If you don't want to have to put all platform dependent operations behind preprocessor directives, and do a build for each target platform, you're going to have to use a language that emits bytecode/intermediate language (Java, .NET languages). The trouble with this, is that neither offers a truly native feel to GUI-based applications. It's a sacrifice, and only you can decide if that's acceptable.

I would probably do it in Java, but that largely depends on your audience as well. For example, techies don't mind a GUI done in Swing, but most end-users feel lost (at least, that's been my experience). If you're targeting techie types only, then you wouldn't have this problem.

Why is Java unacceptable? Is it because of the initial performance hit of the JIT compilation, or is it because you're worried about ease of reverse engineering? If the latter, there are obfuscation tools you could employ to help minimize this.

.NET isn't there in terms of platform independence, especially with regards to GUI-based apps (Windows Forms). The JITer in CLI-conformant implementations is actually really fast in it's native code emission, and it has a higher-level process-like concept called application domains that will actually cache the JIT'd machine code so that subsequence calls use native code instead. Depending on your needs, you may be able to use .NET for some facets of your project as there are "open-source" (shared-source, whatever) implementations out there (e.g. Mono).

My ideas are scattered in this post, but hopefully they make sense. If I knew what application you were building, I would have less ambiguous opinions on the matter. There are several design patterns that could be implemented in C++ to give you a fairly extensible architecture with respect to GUI creation. For example, you could employ the Abstract Factory Pattern to defer instantiation of platform-specific implementations of an abstract interface that defines the routines necessary to render your interface. I've done this on a few occasions to me to add additional implementations in the form of static libraries. Based on the target platform, the correct object would be returned and rendered accordingly. e.g.

GuiRenderer->Win32GuiRenderer
GuiRenderer->GtkGuiRenderer

Of course, that could become unecessarily complex, and it would probably just be more palatable to use a framework which already encapsulates these trivialities.

Let me know what app you're building and I'll give you a more direct answer :)
 

Descartes

Lifer
Oct 10, 1999
13,968
2
0
Another design pattern, Bridge, might actually be a better fit. There exist many that simply help you decouple a given implementation from it's interface to allow you to interchange them (at compile-time or run-time) as needed.
 

ugh

Platinum Member
Feb 6, 2000
2,563
0
0
Instead of Qt, why not try using GTK? Although not as pretty (GIMP Win32 should be an example), it sure functions well with Linux and Win32 (haven't tried Solaris though). I've seen a few IDEs for GTK, but I can't remember their names offhand.

As for Java, there's this SWT library from Eclipse. Heard that it's faster compared to swing. Not sure how fast is "faster" though. You can check it out here.
 

rbayer

Member
Dec 22, 2002
69
0
0
I've done some cross-platform GTK+ stuff and it seems to work fairly well. Just grab glade from gnome.org and you'll have a nice GUI-builder that runs under linux. Just make sure to turn off the gnome features as they aren't nearly as portable as regular GTK+. Anyway, most linux distros include GTK+ by default, but you can grab it at http://www.gtk.org if needed. The Win32 version is at http://www.gimp.org/~tml/gimp/win32/.
 

KevinMU1

Senior member
Sep 23, 2001
673
0
0
Thanks to everyone for your suggestions, they are all thoughtful and I had not heard of most of the products/solutions suggested.

Descartes, the application that I am looking to (re)build is indeed the BitWise Chat program that is in my signature. I laughed (in a good way) when I started reading about your abstract design patterns, because those are completely right out of my Software Engineering textbook that I used last year, and it was just neat to see somebody actually talk about those in the real world! Kudos! In any event, I do understand what you mean by the abstract factory, although I might tend to agree that it might be a bit much work just to get something like that up and running. The GUI aspect is not the only aspect of cross-platform-ness that bothers me, there is also the issues of sockets (which in C/C++ are already mostly platform independent), and also threads, which I know can be very different as well. wxWindows does provide for the threads and sockets if I recall correctly.

My other main concern was that the given tools/SDK be a) stable, b) supported and c) long-lasting. I need whatever architecture I choose to be around and be supported in the future, I don't want to pour a ton of work into something that ends up in a major black hole. Hopefully that sounds more reasonable than paranoid. ;)

Many thanks, again, for helping me explore ideas.
 

manly

Lifer
Jan 25, 2000
13,302
4,079
136
Originally posted by: ElDonAntonio
here's a vote for qt, as your prog looks like freeware!
http://www.trolltech.com
Only the X11 version of Qt comes in the "Free Edition".

Also, I don't think BitWise Chat is open-source/free. Only open-source/free software can be developed with Qt/X11 Free Edition.
 

ElDonAntonio

Senior member
Aug 4, 2001
967
0
0
You can have the Qt Windows non commercial edition free. On Windows, your prog has to be free. On Linux, it has to be free AND open-source.

At least that's my understanding of it!
 

KevinMU1

Senior member
Sep 23, 2001
673
0
0
I won't rule out the possibility of open source, but for now it's going to stay closed-source, that's just a design decision that we're making at this time.

(I kinda forgot about this thread for a while but recently was going through my links and fount it again. ;) )