Cross-Platform GUI Solutions: Qt, GTK+, Tcl/Tk?

  • Thread starter chroot
  • Start date
In summary, Warren thinks that it is a good idea to use GTK+ or Python for developing GUIs. He does not think that .NET is a good choice, and he is boycotting anything Microsoft does.
  • #1
chroot
Staff Emeritus
Science Advisor
Gold Member
10,295
41
Well, I have an app that I'd like to write in C/C++ on both Linux and Windows, and be able to use the same GUI code on both.

I have never taken the time to learn Windows GDI programming, and, from the looks of it, I don't want to.

My first instinct was Qt -- but it looks like Qt is now a commercial product. (Blah.) How about GTK+? I've never used it before. Is it worth learning?

And then there's Tcl/Tk, but it seems pretty much overkill to link in all that crap just to display some buttons in a window.

Any other solutions I'm overlooking?

- Warren
 
Computer science news on Phys.org
  • #2
Or maybe I should just develop in Python.

- Warren
 
  • #3
If your developing non-proprietary software you can just use the Qt/X11 Free Edition. You only have to pay if you doing proprietary development or you want support.
 
  • #4
I don't believe that's true, dduardo.

http://www.trolltech.com/download/qt/evaluate.html?cid=4 [Broken]

- Warren
 
Last edited by a moderator:
  • #5
GTK+ is still a bit of a project. Needs more time to be developed to seriously think of using it.

Python is a very good choice, becoming more popular of late.
 
  • #6
Eh well, Python just uses Tcl/Tk for GUIs. So I might as well just develop in C++ and link in Tk. Of course, maybe Python has some features I might like.. I'll have to look into it.

- Warren
 
  • #7
My tupence...

I would employ a framework that facilitates the creation of a GUI consistent with the platform in which it is deployed; in other words, a GUI in Java's Swing might be [mostly] cross-platform, but it doesn't have an native feel for most Windows users. This is of course assuming you care about the end-user experience in the first place.

It is my opinion that something like wxWindows would be a superior choice over what you've listed so far. You get a GUI rendered with the libraries native to the platform, you get a mostly lucid framework for which to develop your application, and you get to use C++.

Another choice if you're willing to brave the tides of Microsoft is .NET. I'm a .NET advocate, and I get the sense that this is not something you'd really want to consider; however, depending on your needs you could develop a cross-platform GUI.

If none of the above suit your palate, I'd have to go with Java.
 
  • #8
I thought about wxWindows. I used it back in school for some really crappy programs in this one class. My final opinion of it was that it was crappy. Maybe it's not crappy anymore, but it left a bad taste in my mouth.

And yeah, you can rest assured I wouldn't touch .NET with someone else's ten foot pole.

- Warren
 
  • #9
Talking about .Net, why don't you try Mono.
 
  • #10
I haven't actually used wxWindows in a while, but at the time it was suitable; better than the alternatives, at least.

Have you not considered Java? You seem to dislike commercial products, and I can understand that; however, Java has been promoted from Sun's monarchical control to at least oligarchic control with the http://www.jcp.org/en/home/index. It's still not community code, but it's a step in the right direction.

.NET really is a fantastic platform, but those opposed generally can't be persuaded. If you change your mind and have questions, I'd like to answer them.
 
  • #11
Java is absolutely my first choice in nearly all projects of this sort, and that's what I've been using so far. However, the application I'm writing has a lot of byte-wise arthmetic, and I am getting pretty annoyed at the inability to cast byte[4] to int in Java. Instead, I'm having to deal with pretty pathetic performance. And no, I don't really care to know anything about .NET. I've read enough to know what it is and what it can do, and still intend to boycott anything Microsoft does.

- Warren
 
  • #12
Originally posted by chroot
Java is absolutely my first choice in nearly all projects of this sort, and that's what I've been using so far. However, the application I'm writing has a lot of byte-wise arthmetic, and I am getting pretty annoyed at the inability to cast byte[4] to int in Java. Instead, I'm having to deal with pretty pathetic performance. And no, I don't really care to know anything about .NET. I've read enough to know what it is and what it can do, and still intend to boycott anything Microsoft does.

- Warren

Say what you will about MS, but .net is still a very strong application framework. Looked into python yet?
 
  • #13
.NET will hopefully die the death it deserves to die. It's just not necessary.

And I know Python fairly well already. The question is not "should I learn Python?" The question is "should I use Python?"

- Warren
 
  • #14
Originally posted by chroot
.NET will hopefully die the death it deserves to die. It's just not necessary.

And I know Python fairly well already. The question is not "should I learn Python?" The question is "should I use Python?"

- Warren

I would agree .net might not be necessary for client apps, but it is a master on the web enterprise market where J2EE is it's only competition.

btw, what is this app all about, I am intrigued now
 
  • #15
Originally posted by Greg Bernhardt
btw, what is this app all about, I am intrigued now
Sorry, can't tell you.

- Warren
 
  • #17
Originally posted by chroot
.NET will hopefully die the death it deserves to die. It's just not necessary.

Wishful thinking 3 years ago, but there's simply no way .NET will die at this point. Its pervasiveness in the enterprise, open-source (believe it or not), and use in just about every reference architecture implementations available today ensure it a long life.

Python is a great language, but I can't imagine that being preferred over C++ and wxWindows. Another option might be to encapsulate the more computationally expensive facets of your app in a standard C++ library; you could then still use Java for its cross-platform benefits and simply JNI to the library. Just a thought.

Good luck with your app.
 
  • #18
what about fltk?

There is a very easy to use and with good documentation cross-platform GUI Toolkit called The Fast Light Toolkit.
You can find it here: http://www.fltk.org

Here is a description copied and pasted from the link above:

FLTK (pronounced "fulltick") is a cross-platform C++ GUI toolkit for UNIX®/Linux® (X11), Microsoft® Windows®, and MacOS® X. FLTK provides modern GUI functionality without the bloat and supports 3D graphics via OpenGL® and its built-in GLUT emulation. It is currently maintained by a small group of developers across the world with a central repository on SourceForge.

FLTK is designed to be small and modular enough to be statically linked - the "hello" program is only 97k when compiled on an x86 Linux system! FLTK also works fine as a shared library and is now being included on Linux distributions.

FLTK also includes an excellent UI builder called FLUID that can be used to create applications in minutes.

FLTK is provided under the terms of the GNU Library Public License, Version 2 with exceptions that allow for static linking.

FLTK 1.1.x is the current stable release branch. FLTK 1.2 is currently in development and available via CVS. Please see the software page for details. The first 1.2 beta releases will likely appear by the end of 2003, with a final release around the middle of 2004.

FLTK 1.2 will provide enhanced device, rendering, and style interfaces to support more platforms, printing, and application "skins".
 
  • #19
Ernest0x, FLTK looks very promising. Just skimming through the documentation, it has a wide range of tools at the programmers disposal. Unfortunetly, Qt has a much larger library, including: tables, networking, SQL and XML support. Nontheless, FLTK seems to be sutible for small to medium sized projects. This could be exactly what chroot is looking for.
 
  • #20
My suggestion is to use java and simply call C++ code through JNI. That way you won't need to perform bit ops in java, but marely delegate from from java to c++. That way, only the gui is implemented with java, not the actual logic. You could do this, for instance:

public class MyNativeListener implements ActionListener
{
public native void actionPerformed(ActionEvent e);
}

which would then invoke native code when the component it is attached to fires an ActionEvent.

If you want the native look and feel you use either the AWT or you can use JFC with a look and feel that looks native.

Nille
 
  • #21
Is casting really that much of a PITA? Can't you just make a mybyte class that has mybyte.int as a method?

You're using java, so you really can't claim that speed is essential, and the computational complexity of what I describe is not bad.
 
  • #22
Wow, thanks Ernest0x for the link to FLTK -- it does indeed look very promising!

- Warren
 
  • #24
python works

and you can use WxWindows with python.
 
  • #25

1. What is a cross-platform GUI solution?

A cross-platform GUI solution is a software development tool or framework that allows developers to create graphical user interfaces (GUIs) that can run on multiple operating systems without the need for significant modifications. This allows for more efficient and cost-effective development, as the same code can be used for different platforms.

2. What is Qt?

Qt is a popular cross-platform GUI framework developed by the company Qt Group. It is written in C++ and supports multiple programming languages, making it a versatile choice for developers. Qt offers a wide range of tools and libraries for creating modern and visually appealing user interfaces.

3. What is GTK+?

GTK+ (GIMP Toolkit) is another cross-platform GUI framework that is open-source and widely used for creating graphical user interfaces on various platforms. It is written in C and supports multiple programming languages, including C++, Python, and JavaScript. GTK+ is known for its simplicity and ease of use.

4. What is Tcl/Tk?

Tcl/Tk is a scripting language and graphical user interface toolkit that is widely used for developing cross-platform applications. Tcl (Tool Command Language) is a scripting language, while Tk (Toolkit) is a GUI toolkit that provides a set of tools for creating user interfaces. Tcl/Tk is known for its simplicity and is often used for rapid prototyping.

5. Which cross-platform GUI solution is the best?

The best cross-platform GUI solution depends on the specific needs and preferences of the developer. Qt, GTK+, and Tcl/Tk are all popular choices, each with their own strengths and weaknesses. It is important to evaluate the features and capabilities of each framework to determine which one is best suited for a particular project.

Similar threads

  • Special and General Relativity
Replies
13
Views
2K
Back
Top