FLTK, wxWidgets, GTK - light, easy and portable [closed] - c++

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I know that it isn't first topic when somebody considering different GUI libraries. But I have a few specific questions and needs that "the others" didn't have.
(As usual) I'm novice programmer, learning C++ now (finishing thinking in c++) and my university wants me to learn some GUI for programming projects (I'm electronics student) - I'm writing this because personally I would like to know C++ a little bit better before learning some additional libraries. But reality is brutal in this case :).
I'm looking for simple (easy to write in) library that will work under windows, linux and embedded systems (embedded linux or any other lightweight ARM system, not necessary android) without much (best case - ANY) modifications. I would like this library to be lightweight (thats why I eliminated QT), easy to use with other libraries (for audio/video players or some network applications) and languages (I'd like to write also in C, which will be my primary language I believe, maybe some python, D or java). The documentation/tutorials should be also easy and simply written - my English skills are very basic, as you can see reading my post.
After googling for hours my vote is for GTK/GTKmm which allow me to use LXDE, XFCE and GNOME (light/medium/heavy) without installing additional libraries, write code in C, C++, D, Python, Java and almost every programming language that exists. On the other hand many peoples wrote that FLTK is very simple, most portable and probably the fastest one. WxWidgets has many positive opinions so... I just don't know, please help me.
Thanks for your replies,
Pawel

I heard that FLTK is lightweight but have never used so no much comments. I have used however GTK+ and wxWidgets. I would say go for wxWidgets as it is a wrapper around GTK+ in Linux. Apart from that here are added advantages
wxWidgets uses native widgets wherever possible
You can use wxBase library which makes it lightweight (at expense of some feature see this)
Great support than GTK+ IMHO (forum, IRC, mailing list, SO, et al)
Also you can read these entries
http://docs.wxwidgets.org/trunk/page_libs.html
http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits
https://stackoverflow.com/questions/5141116/choosing-between-qt-gtk-and-wxwidgets
https://stackoverflow.com/questions/1257894/wxwindows-vs-gtk-for-cross-platform-gui-programming
http://www.gidforums.com/showpost.php?p=37761&postcount=8
I would personally suggest you go with wxWidgets!

Related

How do I go about making a GUI- enabled desktop app in "pure" ISO C++ [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 9 years ago.
I am trying to make my first desktop app, but I am at my wit's end trying to understand C++/CLI. After several hours of trial and error, it seems to me that it is unrelated with C++( I may be wrong ). I am getting hard time making functions, classes, etc. work, and am unable to understand what is going on. So, I have decided to abandon it for the moment.
Please tell me whether I can make a GUI-enabled desktop app in "pure" C++, using just my Dev C++ compiler. Yes, it might be a better idea to use visual studio, but I want to return to it later. Right now, please tell me whether I can do it in "pure" C++, and if yes, how(i.e., any books, tutorials or some specific learning path).
And yes, the app is just for my learning purpose. So, the issues of cross-platform compatibility, etc. can be safely ignored.
Thanks in advance.
If you're stuck with Windows, some of the more popular choices are:
Microsoft MFC. Not for the faint of heart...
Qt. However, this is also not strictly ISO C++, as it requires a special pre-compilation step. But it comes with a very complete library, is cross platform and widely adopted. The documentation is excellent and the learning curve not very steep.
wxWidgets. Cross-platfrom, popular and standard C++ only. However, relies heavily on the pre-processor and code using it tends to become ugly... (that's my personal opinion...)
GTK+, which is pure C. There is a pretty decent C++ wrapper called gtkmm.
Qt is probably the best C++ GUI framework out there. It does include language extensions that are not 100% C++ but it comes pretty close. There are also tutorials to help you out.
Standard C++ does not come with a gui. There are certain libraries that you could use to create a gui in c++ such as:
Qt
WxWidgets
I hope this helps
Firstly, C++/CLI is not C++, its Microsoft's ".net that looks like C++" language. Ignore it, it was pretty much dead on arrival.
I'm not sure what you mean by "pure ISO C++", if you mean you want to create a GUI app using C++ without any special language features (eg C++/CLI) then you'll be looking at Qt nowadays. Its really rather good and is probably the best C++ GUI system there is today. You can also download the QtCreator IDE that will help you out. (its also all open source and your apps will run on mobile and Linux too!)
If you want something that is Windows-only then you could write old MFC apps (for the desktop) or if you want to be bleeding-edge then write WinRT apps. The native OS GUI features are available in both these systems.

Creating C++ graphic user interface: What is the easiest way to do it? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
So it is my understand that using the MFCs, one can created a GUI for a windows application. But is it easier to use use the Qt package instead? Qt is what I'd use for writing an application that runs on linux but for windows I wonder if using the Windows MFCs would be less difficult and time consuming.
Since you say "Qt is what I'd use... on linux" it sounds like you're already familiar with Qt. In that case I'd definitely recommend Qt over MFC. (Hey, that way you can write your application for both platforms!)
If you're already comfortable using Qt, then stick with it - it's cross platform so it will work fine on Windows. Unless you have a specific reason to, there's no point restricting your application to a single platform (and learning a whole new framework) when you are already familiar with a cross platform one.
Additionally, MFC is a lot harder to work with than Qt. Although it was designed to be an Object Oriented layer on top of WinAPI, it wasn't done particularly well IMO and you still need to be comfortable with WinAPI if you want to be proficient with MFC. The out-of-box widgets are fairly dated and limited in their configurable options, and modifying them or designing new ones is not particularly easy. Being an out of date technology, it is also difficult to find resources and/or support online for when you get stuck.
If you do have your heart set on MFC, you may also want to take a look at wxWidgets - it has a similar "feel" to MFC but is more up to date and cross-platform. Personally I prefer Qt.
Qt can be quite heavyweight, both in terms of implementation (lots of DLL dependencies if you link dynamically) and in terms of building (it adds extra steps to your build process). If your application is more suited to something lightweight (but also more basic in it's functionality), take a look at FLTK.

Programming Language for Mac OS X application [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have an upcoming project coming up in which I want to dedicate several months to making a professional application which is basically a text editor with a special purpose (can't disclose too many details). The program shouldn't be too complicated, but I wanted it to have a nice GUI and be fast enough to sell from either the Mac App store or my website.
I was going to initially make it for Mac OS X and then later Windows and I wanted to know, for someone who is intermediate at programming, what language should I use for this program? Should I use a library? I already have a foundation in c++.
The standard programming language for Mac OS X is Objective-C, however, as a rock solid Unix descendant, it also has great C and C++ support. If you want to write an efficient, nice and native (OS X) look-and-feel GUI, I'd suggest you use Cocoa (it has Objective-C interfaces) which is Apple's default and official GUI implementation for OS X. Considering portabilitiy, however, you may also use some cross platform GUI/widget toolkit, such as QT, GTK+, etc. (which are also, in general, written in C/C++).
The Language
Well, if you have a solid foundation in C++, by all means use C++! However, I must warn you that C++ has a bad reputation for allowing only those people to use it who know every damn feature of the language. Therefore, you may soon run into problems if you don't have a thorough knowledge of templates for instance.
With reference to the platform, in my opinion, all mainstream languages are more-or-less good enough for Mac OS X development ( or Windows development ), it really depends on what you feel convenient using.
The Library
Now we come to my favourite part. Comparing Application frameworks. There are many choices when using Mac OS X. If you want to target multiple platforms ( as you say, you want to also support Windows later on), I suggest GTK+ or Qt. For a comparison between the two libraries, see here.
If you're programming for OS X, check out Cocoa. If you're aiming to create multi-platform applications, check out Qt.
Cocoa uses Objective-C, which is a superset of C - transitioning to it from C++ isn't too difficult, and the Apple Developers site has quite a bit of information for beginners.
Qt works with C++ or Javascript.
You can use marmelade
http://www.madewithmarmalade.com/
To make your application portable and you can write it in C language.
I would use Free Pascal with Lazarus for this, with native interface (still Carbon on OS X though, the Cocoa interface is still in development AFAIK) due to its natural cross platform behavior, both language and libraries so there's no external dependencies required. This would require you to learn another language and framework (it's the same with C++ if you're planning to use QT, GTK, or whatever you've never used before) however.

Portability libraries/frameworks [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I have the book "Write Portable Code" which details POSH, an open-source "framework" (mostly just a header) to help with portability of C/C++ code between different platforms and hardware.
Since Poshlib hasn't had an update in 5 years now, I was wondering what other similar libraries/frameworks exist out there?
For C code, GLib is a modern cross-platform (non-GUI) library which makes it easy to write applications that run on many different platforms without source code changes. GLib is actively developed in an open manner as part of the GNOME project with lots of open source projects using it.
For C++ I would suggest looking at the Boost libraries.
Dear Shaggy Frog,
While I remain largely incurious about your handle, I must say that this is something of a hairy issue. Here's why. I work with the boost libraries day in and day out. They're fantastic, and make innumerable tasks way easier. But I must emphasis that if you use them, you need to use a profiler. Some of the really nice portions of it tend to be a bit slow, and you should definitely read up on best-practices before using certain parts like, say, transform iterators. Boost, though, is worth mentioning because it does make an effort to supply some pretty powerful pieces of abstraction that are almost foreign in the ++cverse.
However, Boost, and other frameworks like it, are not snakeoil. They rock. People who rock use them. People who rock work on them. For more specialized tasks, I'd need to know more about your problem domain. However, one other tool that's really excellent is SWIG, which will let you bundle up any hunk of portable C code into a library that's... well.... accessible.
As for bloat, a lot of that is going to go away when C++0x moves to the standard, thanks to variadic templates, and a number of similar pieces of cleverness. Honestly, I'm tired of people yelling about The Terrors Of Templates. Perhaps six years ago they were a danger due to poor compiler support, but these days, they're part of the language. They live under almost every piece of generic code you touch. Projects like CLang are hammering the very last nails into this coffin as we speak. They aren't a fad anymore. They aren't a magical solution. No one still thinks that. No one you should hire, anyway.
The future approaches. Do you need a Boost?
Most libraries with the buzzwords "portability framework" or "portable runtime" in their names are useless bloat and snake oil. If you want to write portable code, start with the relevant standards and follow them. Instead of reading your vendor's man pages or help files for standard library functions, read the ISO C or C++ standard or POSIX standard. And so on.
Aside from highly crippled embedded systems (note: many/most embedded systems do not fall into the "highly crippled" category) and DSPs, pretty much any environment can be made to be POSIX conformant. A much better approach than trying to design or find a new "portability framework" on top of diverse and incompatible underlying systems is to evaluate what parts of POSIX you need to get the job done, what parts might be missing or non-conformant on systems you're interested in, and whether there are drop-in replacements or workarounds for the missing or broken functionality.
For most people, the only relevant non-POSIX system is Windows. Cygwin is one heavy-weight option for making Windows conform to POSIX, but if you code to a more-inclusive subset of POSIX, you can get by with much lighter solutions and still support Windows.
There is similar Predef project on sourceforge, but it are not updated for several years also.
FWIW, the predef pages are actively maintained and have been continuously updated over the last several years.
Aside from Boost, which all C++ programmers should be familiar with, there are several libraries worth looking at. STLSoft is the first one that comes to my mind.
I have prepared a list of some prominent portability libraries for C and C++ on my personal web site. One can freely reuse it under the terms of the Creative Commons Attribution Licence. I had some experience with Qt, GLib, and the Apache Portable Runtime, and they all seemed to have been mostly OK.
There is also another list on the wikipedia.

Is coding in native c++ still popular? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 12 years ago.
I want to go into native c++ programming after University, but it seems like languages that compile with JIT (like .Net) are overtaking c++. What does the future hold for Native code?
C++ is the seventh programming language I have been professionally paid to program in, and I'm sure won't be the last. My advice is not to think of yourself as a specific language programmer. Even if JIT takes over the world, it has to get down to native machine code eventually, and someone has to write that software.
There are a lot of opportunities to work on natively compiled C++ code. It's especially popular (along with C) in non-PC environments such as embedded and real time environments, and in a lot of situations where there is some level of safety certification required.
Game programming, where performance is usually critical, is another area where C++ is very popular.
It is less popular than it was in traditional 'desktop' applications and web service applications although you can find native code projects in both these areas - especially the former - if you hunt around.
I'm not sure what you mean when you say that you will be "going into native C++ after college". Your career will not be defined by what languages you know, it will be defined by what you can do with those languages.
However, C++ is used widely in many applications. I work in systems and we use C++ for everything. .NET isn't an option in my world, but the guys doing the GIU's next door use it for everything. It comes down to what you want to do with your career. The language you use will come naturally, you are thinking about it backwards.
There will always be a place for C/C++
Any application that needs to be as
fast as possible will be written in
a native language like C/C++
Any application that runs on a device that has limited memory
will
run better in C/C++ since memory
management is more deterministic.
Operating systems will continue to be written in C. That
include
device drivers.
Up until recently one always had the luxury of speeding an application up by using better hardware. Will Moore's law being stretched to the limit, chances are the performance improvements will have to come from software. Chances are that languages that give better performance will come into their own in this regard.
If you go desktop C++ is still the way to go especially if you want to be cross platform.
Java GUI Libraries are way to slow and .NET is not portable (the GUI part).
But C++ is a language beast, the only language where i can understand managers to ask for 5 years experience.
In the server world the VM/JIT has so many advantages that only basic infrastructure is coded native. If this is the industry you want to join learn (infrastructure) or don't learn (applications) C++.
Its also pretty popular in embedded programming where you can't fire up a hundert MB virtual machine.
Since C/C++ is the only fast imperative native programming language left in mainstream you should learn at least the basics.
Yes, of course it is:
http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html
http://langpop.com/
And some of the great features like rvalue-references, variadic templates, uniform initializations, lambdas, unrestricted unions, thread-local storage, extern templates and ... yet keeps C++ to be a good choice for 20 years of the future, until the C++ committee decides to publish another new standard for the other remaining years (like a do...while!) (:
Note that the computers needs native programs to run! Java, .NET, python and ... needs native environment to run on it! so, native programs are the base of softwares.