Should I use a cross-platform GUI-toolkit or rely on the native ones? - c++

On my side job as programmer, I am to write a program in C++ to convert audio files from/to various formats. Probably, this will involve building a simple GUI.
Will it be a great effort to build seperate GUIs for Mac and Windows using Cocoa and WinForms instead of a cross-platform toolkit like Qt or GTK? (I will have to maintain a seperate Windows-version and Mac-Version anyway)
The GUI will probably be very simple and only need very basic functionality.
I always felt that native GUIs feel far more intuitive than its cross-platform brethren...

If you have the expertise, use native frontends, it'll effectively double the job you have to do for UI but from my experience non-native UI is a little bit clunkier than their native counterparts.

Have you looked at wxWidgets? Cross platform native controls.

I would agree that if possible, native front-ends are the way to go. I've not used wxWidgets recently, and I've heard it's come a long way, but back when it was wxWindows, we built an app with it that was spec'd to be built in X/Motif. When we finished the effort and delivered it, the customer said it did not look enough like X/Motif, and we had to re-work the entire UI at our expense... Joel Spolsky wrote a good article on this, but I can't remember the title. What he did say, IIRC, was the problem with Java and some other cross-platform UI was that "your dog barks at my app" - it's the little inconsistencies that annoy folks.

Cross-platform toolkits, more or less, all make the incorrect assumption that the difference between platforms is a matter of button placement and widget styling. In some cases you can get away with this - a Qt app will feel fairly native on both Windows (where UI conventions are very lax) and on Linux, particularly a KDE environment. In general, you can move between Linux and Windows relatively easily; conventions are similar, and the Windows community is lax about them.
Mac is the hard one. Its UI is built around an entirely different paradigm than either Windows or most Linux environments.
But in general, in a native app it's easier to speak the native language of the platform in more ways than just widget style.

Yes.
But seriously, it depends on your goals. I agree that the native UI libraries, with a bunch of effort put into them, will give vastly better results, but for lots of apps, a very basic UI is sufficient and a lot less effort if you take one of the existing cross platform frameworks.
Maybe starting with the CLI and getting functionality working makes the most sense for an audio conversion application.

I'm going to write my own cross platform application GUI layer for this soon.
Depending on the complexity of your application this can be a fraction of what is required for QT, GTK or FOX.
Reason is that we see a tendency that the platform vendors (Apple first) tries to design there system so that it looks unique. This makes it much harder for QT, GTK, FOX and other platform tools to constantly keep in sync with the latest widgets.
When the underlaying technique becomes more and more the same the OS vendors have no option then branding on look and feel of the platform.

wxWidgets used standard c++ syntax and preprocessor thus make you easily alter from plain C or C++. And will produce very native look where is appear, be it on GTK, X11, MS-Windows or Mac.
It's mature since 20yrs of 1rst release, has complete documentation with easy navigating, and supported by large community arround the world.
Coding in your favorite IDE or use prominent Eclipse-IDE and wxFormBuilder as GUI designer. Build wx library and IDE/Toolchain setup could be found on this link: http://yasriady.blogspot.co.id/2016/01/raspberry-pi-toolchain.html
Develop your application in Linux desktop and also provided compiler for Raspberry Pi2 (target application tested work smootly on Raspbian Jessie) ............

Related

How to go about creating a windows application

I've been looking at a lot of different options for creating a GUI windows application. Win32, Windows forms, MFC to name a few. I know my C++ well, I just need some advice on where I should start learning some GUI for windows. Thanks!
Qt has helpful tutorials. Easy to learn. Open source. Many resources on the web!
MFC is quite a dated technology now; The kinds of books/tutorials available for it are similarly aging. QT is becoming far more widely used and is likely a much better starting point from a learning perspective.
There are of course plenty of other alternatives beyond C++; C# and .NET are good choices if you are specifically interested in development on Windows. C++ programmers tend to find their feet in C# quite quickly, although any new language/environment does of course have an extra learning curve
I would look into Qt, OpenGL and SDL (Simple Directmedia Layer).
Qt provides an easy way to build GUIs, I would (loosely) compare it to Java's Swing.
OpenGL and SDL are more about plain graphics, both being used in various games and applications.
I use MFC commercially and I'd have to say for strictly GUI/Windows apps, you might want to look at C# (either Winforms and/or WPF). MFC is getting pretty dated. You can get a lot more done in the same amount of time with C#. Sure it might run a tiny bit slower, but for UI apps, I think programmer time is much more important metric than execution time.
If you want to use C++ for UI, maybe have a look at Qt. It is continually updated/enhanced and is not limited to a single platform like MFC is.
Good luck!
It is as helpful to develop a windows based applications! their are many open sources and Ides to develop windows applications.
One of them are Visual Studios, it is an IDE ie..(Integrated Development Environment) developed by Microsoft for both windows and web based applications development.As it has an advantage that an individual should be proficient in any programming language that he/she knows about.This IDE is integrated with the .net framework which have the capability to manage the code and compile with the help of Microsoft Intermediate Language (MSIL)and CLR common language at Run-time.The type checking is handled by Common type Specification for all Programming languages.JIT compiler is a compiler to execute to semi finished code and turns to code in to bytes.The main languages are handled by these IDE are C++,VC++,C#,Visual Basic,F#,J#..etc

GUI for C++ newbie

With few years of experience with Java I decided it's time to take the time and learn C++. I just compiled and run my first C++ with eclipse (of course) and would like to take it one step fw - I wish to build a GUI.
Question: what GUIs are available to C++, something that is an open-source and runs on Mac and eclipse.
Some have mentioned Qt, some wxWidgets.
A quick rundown on crossplatform gui toolkits that you could try:
Qt: Looks appropriately native on whichever platform you use it on. It has its own build system however, which doesn't always like to play nicely with others. If you want the "beginners" experience in making a GUI with Qt, I recommend Qt Creator. It's a standalone IDE built by the developers of Qt.
wxWidgets: While Qt looks native (it tries its best to emulate the look and feel of the OS you are running on). wxWidgets is native. That is, it uses the GUI elements provided by the operating system. Last I looked at wxWidgets the C++ library was falling behind as far as modern development practices go. You are possibly more likely to learn bad programming habits from this library.
gtkmm: This is from the same guys who make the GIMP and Gnome, which as a MacOS user probably doesn't mean a lot to you. They don't try nearly as hard to fit in as wxWidgets and Qt. However, they probably have the most modern C++ library. They have done a lot of work to use modern C++ development practices. This can be helpful for a new programmer, as you are less likely to learn bad habits from them. On the downside, you'll get thrust into the land of templates and function pointers and such.
Those are the big ones with the most momentum behind them. There are countless others to also consider.
Use Qt
http://qt.nokia.com/products/
http://qt.nokia.com/products/eclipse-integration/
I'd recommend Qt which is open source, has an easy-to-use API with GUI designer, and can be used on many operating systems (Windows, Mac, Linux..) and looks native on whatever it's used on.
You might want to take a look at wxWidgets or Qt:
http://www.wxwidgets.org
http://qt.nokia.com/products/
More generally, see here:
http://en.wikipedia.org/wiki/List_of_widget_toolkits#Based_on_C_or_C.2B.2B_.28including_bindings_to_other_languages.29
I've personally used wxWidgets and found it to be quite good, if you're after a recommendation.

How does C++ builder stack up against other RAD IDEs?

It has been a few years since I did any development for PCs (I usually do embedded software).
At that time I was highly proficient with (Borland, now CodeGear) C++ Builder. Time has moved on, C++ Builder has become extremely expensive and there are alternatives (MSVC studio, NetBeans, QtCreator, maybe even Eclipse with the right plugins). Others?
Three things concern me (in no particular order), ease of use, additional GUI components and cross-platformness.
Ease of use - I want an IDE which helps, not hinders me. Good debugger, refactoring, jump to variable declaration, usage, that sort of thing ..
GUI components - when using C++ Builder I was impressed by how easy it was to develop additional VCL components and how many were available, often for free. Thus if I wanted a standard string grid where the cells also could contain pictures, checkboxes, etc, I could probably find one, or roll my own.
I am not sure what the current state of play is with respect to add-on components. Do other systems have anything like http://www.tmssoftware.com/site/ ?
Cross-platform - I personally use Linux for everything, but realistically, the majority of my users have Windows installations. So, cross-platform is "nice to have", "all other things being equal".
Now I have to pick a solution and stick with it for the next few years. Which one, given my points above (cost plays a role, but is not make/break)?
Thanks in advance for your help.
I have used both C++ Builder and Visual Studio.
Over the years I have always preferred C++ Builder over V.S.
Builder and VCL just feels much better designed than Microsoft's products.
(Even the Borland library source code just looks cleaner than anything
that comes out of Microsoft).
The integrated debugger in Builder is truely integrated and quite intuitive to use.
I find Builder compiles much faster than Visual Studio.
Builder 5 had a problem that made it unnecessarily slow,
but at the time it was still faster than VC++
and the latest Builder versions have faster compile times.
Accellerators such as TwineCompile make Builder even faster.
I've never tried to create custom C++ controls for Visual Studio,
but it is fairly easy to do in Builder.
Last year, CodeGear released a free version of TurboExplorer
(I haven't used it myself) which includes the IDE
and RAD (although limited) http://www.turboexplorer.com/
TurboExplorer can be used for commercial apps.
I have not been happy with Java based IDE's where are always slow.
I.e. SunStudio12 which is good (and free) but the UI is slow response.
I use Code:Blocks on Linux which has reasonable usability,
but haven't done any RAD work with it.
I never used C++ Builder but used to be a big fan/user of delphi. I normally work on server apps in c++, with some java. Reciently I started writing some small productivity apps for myself originally I used java, but then moved to Qt.
Now I love it. The library feels well designed just like vcl did in delphi. The signals/slots mechanism is great, I am still surprised how often I don't have to write code to wire up a dialog box. Using qt is easy and the code you write is very easy to read and create. I haven't yet had to write my own widgets, I think qt's model/view architecture splits the roles very well making the stock widgets very powerful. For example when using a QTableView most display and editing functions can be provided by the ItemModel, more powerful control is provided by an ItemDelegate. I have found these easier to reuse than writing custom widgets although it seems easy enough from looking at the documentation.
Qt creator is basic but does 95% of what I require, integrated project, gui designer, code, debug and help. Has support for CMake as well as qmake. It doesn't have advanced features like refactoring, but the intelli sense better than VS2005. However the next version of KDevelop looks very promising and will include these. You could also use eclipse if you wanted these features, or move between eclipse and qt creator as required. But I am very happy with qt creator.
On the cross platform issue, I develop my apps on Linux at home and tend to use them on windows in work. So far everything that works on linux works just work windows and looks like it was written for it too.
The strength of C++ Builder (and also Delphi) is the VCL GUI framework, it is easy to work with, and delivers true RAD development. There are a lot of alternatives to VCL which all have their strengths and weaknesses. The strength of VCL is the close ties with C++Builder/Delphi which makes it work very well with that combination. The downside is that it is propitiatory software, which means that you are unlikely to port your code to other IDE's or platforms without official support from Codegear/Embarcadero.
There is however some free alternatives out there, one of the more interesting being the Lazarus IDE. The Lazarus IDE is an IDE for the Free Pascal language, this is very similar to that of Delphi, I must admit that I am not a Delphi guy myself, so I am unable to go into too much detail about this. Lazarus have a GUI framework much like VCL called LCL. From the brief looks I've had on it, it looks very similar. There are several good things about the Lazarus/Freepascal package especially for your case. It is free, it can compile and build for both windows, linux, and mac, it has 64 bit support. Further more the compiler seems more modern than the Delphi one.
Lazarus running on Windows 7
Lazarus running on Linux (GTK2)
Lazarus running on Mac OSX
More screenshots can be found here: http://wiki.lazarus.freepascal.org/Screenshots
The problem with Delphi/C++Builder is that the VCL is not currently crossplatform capable. Although this is planned for future versions (as far as I recall) it is not yet implemented. Having noted that, there are some considerations as to whether the C++Builder will continue to be maintained or not, in here there is some comments on this: here.
Qt has been mentioned and it is indeed a very strong GUI framework and the Qt creator is a fine tool, personally though I like to have a very close bond between the IDE and the GUI framework like it is the case with the VCL, but that is very dependent on the developer.
Edit: Just a thought I had, when comparing C++Builder to other RAD IDE's it is easy to include IDE's for the .NET languages and Java. These use languages created for this purpose. C++ used in C++ Builder does, although in Borlands version slightly modified, not. This does raise an interesting question, is using C++ for RAD applications necessary and justifiable? Why not use a tool (language) that is written for the purpose. I am aware that C++ Builder is written for RAD development, but the language behind it was not designed for this purpose. If your need is truly rapidly developed applications, I would consider looking for other languages, but if you dependent on C++ for whatever reason, could be 3rd party libraries etc. Then C++ Builder is in the C++ world an excellent RAD development platform.
Short answer is NetBeans. It is cross platform, it is easy to use, although it is made-in-java but still it is fast.
PS: If you also do or intend-to-do programming in java, it will be convenient to use/learn this one IDE for both.
You can also use wxForms for C++ Builder and use wxWidgets to create cross platform applications. It works with the existing C++Builder IDE and make use of the same form designer.

Should a person new to windowed applications study X, GTK+, or what?

Let's say the factors for valuing a choice are the library of widgets available, the slope of the learning curve, and the degree of portability (platforms it works on). As far a language binding goes, I'm using C++.
Thanks!
Pure X is quite hardcore these days, and not very portable. Basically, there are three major toolkits:
GTK+ (and C++ wrapper GTKmm)
Qt
wxWidgets
which are pretty comparable, so which to choose is a matter of taste. All three run on major three operating systems, although GTK+ on Mac and Windows is little bit awkward.
Qt is very good. It has quite large library (not UI only). Runs on a lot of platforms.
My personal favorite: Qt. It's cross-platform, it's very intuitive, it's extensively documented, there's bindings for many languages (the original is C++), and it's actually fun to develop with it.
Unless you're planning to write your own UI toolkit, there's really no point in using X directly anymore. Too hard, too much work.
On Linux, you have the two main choices - GTK and Qt. Both work fine. Qt works better as a native C++ toolkit than GTK itself, although GTKmm is a decent C++ wrapper for it. GTK tends to be usable from more languages than Qt, but that doesn't matter if you're using C++ anyway.
Both are cross-platform, but GTK feels somewhat alien on other operating systems, particularly on Mac OS X. Qt feels completely native on Windows, and fairly close on Mac OS X. It also provides a lot of other cross-platform functionality beyond the UI, such as threading, filesystem access, networking, and so on. Qt certainly seems to win on the portability front, at least.
Generally, go with something that's popular - there's more chance of finding good examples, pre-made applications you can dissect, libraries you can use, or even just finding help here.
As you requested a widget library for C++, then I would suggest QT, which was created for that programming language; GTK is good too, but it was created for C (as many of the libraries created for the GNU project which privileges C against C++).
Nobody uses X directly while creating an application; the only people who work directly with X is who is creating a new widget library, as already reported from other people here.
GTK+ it is: runs on most Linux distros and Windows too.
Of course there are also Qt and WxWidgets which are cross-platform.
In my opinion, the best C++ GUI toolkit is Qt http://qt.nokia.com
It's cross-plateform (windows, mac os x, linux), efficient and has quite a few nice extensions (Qwt, Qwt3d, QGLViewer, ...)
On the other hand, if you want to learn about GUI programming, I would learn quite a few systems, including GTK, Tk, Motif.
I suggest getting a generic book on GUIs. I have used Borland's, Windows, wxWidgets, QT, and PEG windowing frameworks. In summary, there is no standard, but GUI systems are Event Driven. Study up on Event Driven programming and that should give you an excellent foundation.
I think you can start with wxWidgets.
If you are most familiar with an interested in C, GTK+ is a good place to start. If C++, QT is probably a better choice. Your desktop of choice is also a factor. Gnome uses GTK+, KDE uses QT.
Raw X programming is much to low-level to start with. Very few programs are written directly against the X API directly. There have always been toolkits layered over it. Some of the older toolkits are Motif (Lesstif) and Athena. Don't try to start with those though, they are very old now.
I think there is another issue that you did not mention: where do you want to go with it?
do you want to "just learn it" or do you have a specific application in mind?
if you have an application, perhaps you also need to consider:
what OS you plan to run it on
how is the community supporting it: active? is it difficult to get help?
what performance do you need/expect?
how long do you plan to support it? (you might decide to run^H^H^Hmove away from C++ in a few years, and if so, would it make sense to use a different language - ie Java?)

Advice for C++ GUI programming

I have been writing C++ Console/CMD-line applications for about a year now and would like to get into windows GUI apps. For those of you who have taken this road before, what advice/tips can you give me. Ex: good readings, tutorials, approach tactics, etc...
I know this is a really broad question, but i really don't know how/where to start, thus not knowing how to ask this question properly.
I highly recommend the use of the Qt Libraries for several reasons:
The Framework is freely available for Windows, Linux, MacOS X, and a couple of mobile systems. Since version 4.5 the license is LGPL, which basically means that you can use Qt even in commercial applications.
The design of Qt is out-standing, e.g. they use modern design patterns and a very consistent interface design (I don't know many other libraries that use object-oriented ideas in such perfection). Using Qt is the same as using Boost: it will improve your own programming skills, because they use such beautiful concepts!
They are bloody fast, for instance in rendering (due to the different back-end for OpenGL, DirectX, etc.). Just have a look on this video and you see what can easily be done with Qt but is hard to achieve with native Windows, Mac, or Linux programming.
They have a really great documentation, with tons of tutorials and a very good reference. You can start learning Qt easily with the given docs! The documentation is also available online, so have a look and see by yourself.
As mentioned before, Qt is cross-platform; you have one source-base that works on all the important operating systems. Why will you limit yourself to Windows, when you can also have Mac and Linux "for free"?
Qt is so much more than "just" the user interface; they also offer network and database functionality, OpenGL bindings, a full-working web-browser control (based on WebKit), a multimedia playback library, and much much much more.
Honestly, I wasted a couple of years by developing software natively for Windows, while I could have been so much more productive.
For C++ you have two choices, Native or Managed.
For native development, my team (at Microsoft, in Windows) uses the Windows Template Library. It works very well for us.
You should learn the basics of Win32 and how Windowing works. The canonical tome is Programming Windows®
For Managed development you can use C++ with Windows Forms. However, windows forms has been supplanted by Windows Presentation Foundation (WPF).
Here is a good site that can get you up to speed.
This tutorial is useful
You can use Visual C++ 2008 Express Edition for your tools (they are free).
My best advice for Windows C++ GUI programming is don't do Windows C++ GUI programming.
I realize that is an extremely uninformative/smartass response if it's not qualified, so I'll note that you don't state that you need to do C++ Windows GUI programming, but that you "Would like to get into Windows GUI apps." If that is the case, and you don't have a very specific reason to use C++ (i.e. gigantic existing legacy codebase written in MFC or a bunch of C++ code that you want to build a front-end for but would be a pain to expose to .NET code), then it is going to be a lot easier and more productive to go the .NET route and start learning Windows Forms or better yet WPF using C# or another .NET language of your choice.
If you do need to go C++, then I would second the recommendations for 3rd party toolkits like Qt or wxWidgets, as the state of C/C++ GUI programming tools from Microsoft is now abysmal.
Most windowing libraries and technologies use similar idioms. Pick one and learn it.
The Windows Template Library is a very nice veneer for Microsoft Windows while sticking with C++.
For cross platform C++ windowing toolkits (they work on Microsoft Windows as well as other platforms) you can try QT or wxWidgets.
Well, for the Windows GUI, get used to referencing the MSDN a lot, assuming you want to deal with the API directly.
My favorite resource for learning the basics was theForger's tutorial, but there are hundreds of books and other sites out there.
I guess an important place to start is your toolkit. You tagged this visualc++, so I assume you are looking at that, however remember there are other toolkits like Qt.
I would suggest starting at Microsoft's tutorials.
+1 for Qt. I would put documentation at the top of my list of requirements for a GUI system. Qt has great docs and there's a huge community behind it. Also there are several books about it. Good docs are extremely important if you are working alone with no other team members to rely on. Alternatives are wxWidgets, MFC, WTL, FLTK and many more. They all have pros and cons. Eg FLTK is small and only provides GUI whereas Qt and wxWidgets also include networking, database access etc. Qt seems to have the most momentum at the moment after the Nokia buyout eg the release of Qt Creator which enables you to develop apps outside of Visual Studio.
It has been so long since I worked with C++ on Windows GUI, my word is always avoid C++ in Windows GUI unless you have a very good reason, I mean a good darn reason, if you need some performance C# is more than enough for 90% of the cases, and if you need more power write your performance critical thing in a C++ dll, and call it from a Windows Forms or WPF application.
It will save you hell of a lot time.
Still my opinion, if you have another I totally respect that
The first question is that do you want to develop Free, Open Source, for personal use or Commercial applications in C++?
If you want to develop for personal use! Then you can go with some good C++ Toolkit, Framework or API.
If you want to develop an GUI application that will be open source or free. Then you can go with C++ Toolkits, Frameworks or API's that have the GPL or any open source license that fits your needs.
Even you can develop Commercial applications with open source toolkits, frameworks or API's that have LGPL license.
The second question is that do you want to develop for the Windows, Mac, Unix or Linux? or these all, even for the mobile platform?
If you have a Windows user, as I am, and want to develop only for the Windows, I mean not for the cross platform, you can go with Win32 API, although, learning Win32 API is harder but it gives you the complete control over the machine. Believe me that no other tool would you provide the complete control over the machine. If you dislike Win32 API, for any reason, you can go with MFC, which is another technology from Microsoft, but is not free, old and has less attention now a days. If you decide to develop with .NET platform, you have C++/CLI, an extension to C++ language for developing .NET applications. .NET gives you the type safety, OOP and a built in garbage collector, provides you the all API's related to Windows and x86 or x64 machine in one package.
.NET has its own world! Microsoft has decided to port .NET to other operating systems too, Mono project is an example... You can develop nearly all kinds of applications using .NET.
If you want to develop C++ GUI applications for the cross platform, then Qt, WxWidgets and U++ are available for your help. You can write once and deploy anywhere with these libraries. Many open source IDE's and compliers are also available to develop C++ applications with ease. Note that if you do not want to develop for the cross platform, any cross platform library would be overhead and unavoidable increase in size of the executables.
Is your C++ knowledge is good enough to program software systems?
In fact, if your knowledge of C++ is not enough deep and you do not understand programming methods like OOP, Encupsolation, Classes, Interfaces, Types, Programming Patterns and so on, you can not use any toolkit with full potencial.
Do not forget that every Toolkit, Framework or API is implemented in some programming language. If you do understand the language very well, you can use the toolkit very well. I think, you would understand my point.
Put aside WPF or VC++ or Qt, You can also try out several libraries such as :
OpenFrameworks
Processing
...
there's an active project for developing Gui with Openframeworks here:
http://www.syedrezaali.com/blog/?p=2172
Are you familiar with Microsoft Visual Studio and .NET technologies? Since you want to develop for Windows platforms why don't you start by taking a look at Microsoft Visual C++ Express Edition.? Explore a little with the available tools from MS and search for some tutorials.
We are in 2020 but the question is still pertinent. I agree with Qt users, it's a great framework.
However, there is also C++Builder that offers you design GUI visually at design-time. C++Builder application can be built on both VCL (Windows only) and FireMonkey (cross-platorm) frameworks. Clang compiler can produce both 32 and 64-bits native executables. Community edition of C++Builder is free. Delphi integration is seamless: C++Builder project can include Delphi files directly and use any existing Delphi component packages and libraries.