What language can create relatively quick starting cross-platform applications with custom widgets? - user-interface

I want to create an application that "plays well as a tray icon". That is, it starts up quick and doesn't hog resources. The application will likely need some custom UI widgets as well, and although I mention "tray icon", cross-platform would be ideal as well.
Obviously, I can do this with C++ and some cross-platform UI library (I wouldn't know which one), but I was hoping for a language with garbage collection.
I can do this with Java, but I'm guessing even after compilation, it likely builds a relatively large and slow-starting .exe (maybe the SWT UI library would cut some bloat?). Another way to ask this question, is it possible in Java, and if so what is the best way to make quick/snappy app? I want it pop up similar as popping up Google Desktop search.
Is there something "between Java and C++?"
So,
* Higher-level than C++ (mainly GC)
* Quick starting and resource friendly/snappy (.exe or otherwise)
* Cross-platform desktop UI (even with custom UI widgets)

Try Python it is a high level cross-platform language with GC.

Use Qt and pick an arbitrary supported language
Here is the link to it : Qt - A cross-platform application and UI framework
You can use it freely if you don't develop commercial application.
The reference documentation is very good, and you can find a lot of help all over the net.
It uses a hierarchy of the objects, and if a parent object destroys, it frees up all the children. In a GUI app you don't have to bother with deallocations, if you use the proper syntax. I am developing a 2D presentation application for linux with it, and I am very satisfied with its performance.
Don't forget to use Qt Creator if you decide to use Qt, it simplifies project creation, contains "intellisense", very useful. Without it Qt is a pain..
Supported programming languages: (quoted from qt site)
Programming Language Support
The Qt API is implemented in C++, and
provides additional features for
easier cross-platform development. QML
– introduced with Qt 4.7 – QML is a
JavaScript-based declarative, language
designed to describe the user
interface of a program: both what it
looks like, and how it behaves.
Bindings to Qt exist for several other
languages, including Ada, Pascal,
Perl, PHP, Ruby, Python and Java™.

Related

Differences that matter between GTK+ and QT?

What are the finer differences between QT and GTK+?
Specifically I need to know the finer differences.
Language neutral, Windows/Linux neutral. Just the finer points please...
How native are the widgets / controls to the window manger, from its standpoint? Example: If it were a text control, would it process: a WM_COMMAND or EM_SETSEL message sent to it? If not, how do third-party applications / screen readers interact with the control / widget?
Advanced widgets available in one toolkit and not available in the other? Add-Ons are fine to describe.
What is the quality of theming from a multimedia / special effects standpoint? like powerpoint style special effects such as fade-ins of widgets/docks. What's the ease of coding for these scenarios?
Note: I'm probably biased towards Qt as I never used GTK seriously.
Qt's graphics view and scene system is awesome, GTK only has low level Cairo.
Writing custom widgets seems easier with Qt, probably because of the OO design. I don't know which API has more "advanced" widgets, but the basic ones are probably enough for most applications with a little bit of customization.
If you want a completely custom display for your app with special effects and all, you can easily write one based on graphics view/scene. Qt 4.7 also adds Qt Quick to design fancy interfaces, I didn't have the opportunity to test it yet but it looks pretty cool.
Overall I think both are great frameworks and offer enough for any application, but with Qt you get everything in a nice package, when you have to use 3rd party additions or reinvent the wheel to get the same job done with GTK.
Although you didn't ask this, it's worth pointing out the different philosophies between Qt and Gtk+ (or Gtkmm, the C++ version of Gtk+).
Qt is a full application development toolkit. It includes XML parsers, concurrency framework and so on. Gtkmm is not. From the gtkmm documentation:
gtkmm is a GUI toolkit and nothing
more, and it strives to be the best
C++ GUI toolkit. That mandate does not
cover generic C++ data structures, an
XML parser, or database access.
The probably more fair comparison is between Qt and Gtkmm + a set of GNOME libraries.
For advanced widgets the GNOME libraries are really nice - take libgoffice, for example. But it doesn't have a beginner friendly documentation and you will end up having to ask questions in the mailing lists or the IRC channels. Qt is also very nice and have a much friendly documentation. The quality and availability are equivalent, in my opinion, but Qt usually have more documentation or, at least, is documented in a way more friendly to "outsiders".
Both have high quality presentation and effects. No meaningful difference. I like the Gtk+ appearance more than Qt, but it just a matter of personal taste.
Not a complete answer, but:
I find it really difficult to
customize widgets in Gtk+, e.g. I
want the behavior of widget X, but
need to tweak the look beyond the
usual style settings.
OTOH I don't like Qt's moc, but that's more of a
personal thing.
I'd also strongly
recommend Gtkmm (the C++ wrapper)
over plain Gtk+.
Sorry if this bias to qt and shallow
Qt has many eyecandy effect ( dont know about gtkmm).
Qt has Qtconcurrent, higher level api for multithreading. probably more readable
than Qthread Qmutex blablabla...
Based from your question I think you want to integrate desktop app to www,
so just compare for yourself between qtwebkit , gtkhtml and gtkwebkit which one is likely to fit you better.
I've narrowed it down to XULRunner or GTK+.
Here's why:
I need to quickly become familiar with the internals. QT makes this difficult for me with so much on their ease-of-use solutions.
QT is HUGE! I stopped a custom compile after it had been running for over 4hrs on my 3Ghz P4! to be fair, QT provides many precompiled binaries
Out of the box themes for QT are rather too 'professional' looking. I need something cool, GTK+ has some neat themes which I can modify.
I don't need / want to use the framework for networking, file management, multimedia, webkit, or anything besides a GUI frontend to other apps.
Note that the license in Qt is LGPL which is not good enough for many commercial projects. Same for GTK+, but at least you can pay for legally using Qt in commercial projects.

How does Qt only use C++ to make custom GUIs for some many platforms?

I don't see how Qt does the low level graphics work, in order to create its own custom GUI look/feel for each platform. Does it utilize each of the platforms APIs or something? I ask because I am really wondering how I could go about creating my own framework in order to make a custom GUI application with a unique graphical look.
"How does QT only use C++ to make custom GUIs for some many platforms?"
"Does it utilize each of the platforms APIs ... ?"
You answered your own question. It makes a common library for developers to write their applications with. The application developers write their application only once, not caring about platform specifics. Then, the library author puts out different versions of the library for each platform, which handles all the specific UI calls. This is called encapsulation:
http://en.wikipedia.org/wiki/Information_hiding#Encapsulation
If you were to write your own such library, you would need to figure out what is common between all of the platforms you target, or figure out what high-level concepts your application would need, and create that abstraction. Then, implement that abstraction for each of the platforms you wanted to support.
Edit:
Also see Juliano's comment. This seems like it might be closer to what you want to do, rather than the question you asked. I'd not re-do the work that Trolltech or the WxWidgets team or the Gtk guys or the Mono people did, if I could possibly avoid it.
The good people at Trolltech (now Nokia) write all the platform specific code for you. Only the interfaces to their library remains the same across platforms. You do have to make sure that you only use their classes and don't make any OS-specific calls.
If you want, you can modify the graphics and the handlers to extend the Qt library and create your own look and feel.
Your Qt application doesn't have to have the plain standard platform graphical look, but there are ways to design unique apps with Qt.
For instance, you can style your application with style sheets: http://doc.qt.io/qt-5/stylesheet.html, or even with a custom QStyle (which is not very easy): http://doc.qt.io/qt-5/qstyle.html
Qt Quick is a new technology we're introducing in the upcoming Qt 4.7 (check out the beta if you're interested). It allows you to easily define custom UI components from simple primitives, with custom animations, state transitions and other effects. See for example http://www.youtube.com/watch?v=8G4U7QWRajg.

Transferring from web programming to GUI programming?

I've been doing web development for about six years now, and somehow have entirely avoided ever developing a desktop application.
I am considering writing a desktop application (I'm thinking something similar to a Word clone) on Linux but have no idea where to start. I hear of Qt and GTK+, but I'm curious if there are any frameworks that are similar to web development. Language isn't a problem, as long as it isn't Java.
You really want to go with Qt these days. Both Nokia and Intel are now pushing it as the main GUI in their new distro Meego. This means, if you are using Qt, you'll be able to target all their platforms (both desktop, embedded and phone domain), including all the platforms already supported by Qt.
Qt also comes with a GUI Designer and an IDE which will support you in the whole process, and soon there will be QML, which is a declarative UI language, for even more rapid development of apps.
Take a look here:
http://qt.nokia.com/products
http://www.youtube.com/watch?v=U7IgwNrcln8
http://www.youtube.com/watch?v=xoo_Ows1ExU
http://www.youtube.com/watch?v=Fr5FuGhTqm8
GTK+ and QT are GUI frameworks. They use xlib under the hood and encapsulate the nuances of xlib and provide you with an easier interface.
For rapid development you can use GLADE and quickly build GUI applications in C/C++.
Check out wxWidgets, it's another framework that is usually compared with Qt & GTK+
Go for Qt. And, if you are webdev, you will find in QML one of the best instruments EVER.
It has:
A Declarative approach to UI definition and Graphics elements Behavious/Animations
It's cool and simple at the same time
For now is only available in a couple of (old) binary drops, or by clone-compiling qt.gitorious.com/qt, branch ">4.7"
If you don't have to release today, but do you have time to develop and test, then QML should be "stable" by end H1 2010. If I got the schedule right ;-)

How to decide GUI Framework for desktop application project

I am working on a new small utility desktop application but I am not really able to choose the GUI framework to use. I have worked on both JAVA,C# and C++, so language is not really a constraint. My criteria are:-
A very well designed architecture, something like QT. It's better if it follows typical C++ design methodologies.
Layout management should be easy, intuitive and not really cumbersome. I hate adjusting pixels on screen.
Its license should be open.
It should look good :)
Mentioned QT seems to comply to all your requirements. QT has "deploy everywhere" attribute, whilst Java needs no deploying at all (it depends on what is use of your utility).
Ad. 2 QT has really convenient GUI designer.
Ad. 3 LGPL. Usually it is enough.
Ad. 4 It is always matter of taste. IMO QT4 looks awesome under linux, but it's windows look'n'feel is correct at best. It's strong point is, that without additional tweaks it almost everywhere looks native.
I've been using Swing, and it works fine. NetBeans (a decent IDE by itself) even supports graphical GUI building.
It's well designed (basically
everything is done with listeners,
functions that are registered for a
certain event). It has bindings, so
you don't have to write code to set
up a value in a text field or read
it out
Layout is not perfect, but
acceptable within NetBeans. It's
WYSIWYG (almost). Look-and-feel can
be changed on the fly.
License is free. Source-code is not
available, I think.
Looks fine on Windows and Linux,
less so on OSX.
You could always try SWT. The advantages of Java with the standard L&F of supported operating systems.
Well designed. Lots of
documentation, and very easy to
develop with. (If you know Swing,
you can pick up SWT in no time.)
I believe layout managers do exist
that support SWT. I'm not positive
about this though, as I typically
don't use layout managers too much.
Uses the Eclipse Public
License. Should meet most of
your requirements.
From Wikipedia on SWT:
SWT is written in Java. To display GUI elements, the SWT implementation accesses the native GUI libraries of the operating system using JNI (Java Native Interface) in a manner that is similar to those programs written using operating system-specific APIs. Programs that call SWT are portable, but the implementation of the toolkit, despite the fact that it is written in Java, is unique for each platform.
Hope that helps you.
I'd suggest wxWidgets if you want to program in C++ or wxPython (the python language binding of wxWidgets if you know or don't mind learning Python.
Architecture is similar to QT I think.
Layout using sizers. Quite easy once you get the hang of it.
Liberal open source license.
Widgets are native on all platforms (Windows, Mac OS X, Linux).

GUI toolkit for rapid development?

I want to write a front-end to an application written in C/C++.
I use Solaris 10 and plan to port the application to some other architectures (Windows first).
I'd recommend taking a look at wxWidgets to provide some cross platform UI widgets that will work on Solaris and Windows.
Qt 4 is the best tool for this job. If you want to work with other languages, it also has bindings for Java and Python
On a Mac, this would be easy. The Cocoa API is great when programming in Objective C (which compiles fine with C/C++ files).
Otherwise the situation is a bit more grim. As for Rapid prototype, you might want to check the CodeGear (Borland/C++ Builder) tools. I think their VCL library is cross-platform.
Otherwise, you could interface with a scripting language like Ruby and use fantastic front end libraries like Shoes. Python also interfaces with wxWidgets to make writing cross-platform front ends easy. Keep in mind that this all requires taking time to make sure your C/C++ code can talk to the scripting language. This is not trivial, and the amount of effort required depends upon the style of your code base. (Oh my God.)
Lastly, you could just use wxWidgets itself. This might be your best bet since it requires no additional overhead than coding the UI itself. That said, C++ is not the greatest language for designing UIs.
And super lastly, consider writing a code generator that converts from say Shoes to whatever wxWidgets code is needed to generate the same Shoes app. That way you can do easier UI design but still get C++ code in the end. Likewise, you could code gen off of the Python/wxWidgets code. Then sell such a code generator. :-)
GTK-- and Glade.
Thats' the C++ bindings on GTK
GTK will work on windows ( just look at GIMP )
Works everywhere, no QT license to mess with your millions-making.
I use wxWidgets myself. It makes good use of the C++ language features and uses smart pointers, so object and memory management is not that hard. In fact, it feels like writing in a scripting language.
Coupled with a dialog editor/code generator like wxFormBuilder or wxDesigner, (links to screenshots) it becomes a good toolkit for rapid development.
Have a look at FLTK which supports X11 and Windows.
Ultimate++ is a cross platform rapid application development framework for C++. It is aimed specifically at rapid development. The Ultimate++ website provides some comparisons to other frameworks mentioned such as Qt and wxWidgets.
I have used ASP.NET Web Forms to make UI front-end to collection of command line application written in legacy language, RESTful-ish web service, and bash scripts.
Once it works on Firefox, it should work at least on Firefox on other architecture. If you haven't played around with it, you should give ASP.NET a try (ASP.NET MVC seems to be the current trend). Not quite the same as RAD, but it does give you visual design of forms etc.

Resources