5

For GUI programming in C++, we can choose between too many libraries, such as Qt, Gtkmm, wxWidgets, FLTK and there is another one which already exists: Nana.

Nana C++ library is using modern C++ (C++11) language features such as lambdas, templates and more, and it seems to be compatible with C++ standard library.

If a GUI library is 100% compatible with C++ standard library, then why cannot we have it for next C++ standard (C++14 or C++17)?

Which conditions are necessary for a library to be in C++ standard library? if conditions are not defined, then we are doomed forever to be in a black hole of text and it will hurt your heart! Otherwise if conditions are defined, then where can i request a library to be within the next C++ standard?

qPCR4vir
  • 3,521
  • 1
  • 22
  • 32
Sadeq
  • 7,795
  • 4
  • 34
  • 45
  • 1
    As for your question, "where can i request a library to be within the next C++ standard?" I'd suggest that you write one and try to have it added to Boost. If you can pass that gauntlet, you have a good chance of getting it approved by the committee and incorporated in to the Standard. – John Dibling Jul 12 '13 at 12:40
  • 2
    @JohnDibling: thanks :) i find someone that has tried this: http://lists.boost.org/Archives/boost/2012/06/194393.php – Sadeq Jul 12 '13 at 13:16

2 Answers2

8

Bjarne Stroustrup has already answered this question:

Why doesn't C++ have a GUI?

C++ has many commercial and open source GUIs (e.g. Gtkmm, SmartWin++, V C++ GUI, FLTK, and Qt). In particular, every platform vendor provides a C++ library to access their GUI. The problem is that it doesn't have a standard GUI, and that is indeed a major problem. Note that providing a GUI is both a technical and political problem. There are lots of GUIs with lots of users, and generally they wouldn't like some other GUI to be declared standard. Anyway, the standards committee do not have the resources to build a new and better GUI.

John Dibling
  • 99,718
  • 31
  • 186
  • 324
  • 3
    thanks, then he means that we don't need a standard GUI because we have too many non-standard GUIs! – Sadeq Jul 12 '13 at 12:44
  • 1
    Well, my take-away from that is there is no pressing need because there are many libraries. But the real reason why they don't do it is because they don't have the time or resources. – John Dibling Jul 12 '13 at 12:54
  • 1
    I think Stroustrup is being polite about this "major problem" being "both a ... and political problem". – thor Mar 18 '15 at 06:17
4

How would you draw a button on a heart pacemaker?

You should have said:

or GUI programming under Windows or Linux in C++, we can choose between too many libraries, such as Qt, Gtkmm, wxWidgets, FLTK and there is another one which already exists: Nana.

C++ is operating system agnostic. Imagine how such a library would be supported on a platform that has no gui at all. Like a microcontroller, or some embedded piece of hardware.

Never say never, but I would never expect a GUI library like the ones you've mentioned to be added to the C++ Standard.

If a GUI library is 100% compatible with C++ standard library, then why cannot we have it for next C++ standard (C++14 or C++17)?

Because those GUI libraries also use platform- and OS-specific features to do what they do.

John Dibling
  • 99,718
  • 31
  • 186
  • 324
  • 8
    but we will have file-system features in C++ standard library which are OS specific. – Sadeq Jul 12 '13 at 12:26
  • In a sense then, C++ already does have a GUI library. – John Dibling Jul 12 '13 at 12:29
  • 5
    and in some special devices we don't have a terminal or any display screen too. if a device don't have an ability to show a button, then we don't need to use this feature, but it doesn't mean we don't need this feature at all! – Sadeq Jul 12 '13 at 12:29
  • 1
    Full-featured GUI frameworks are incredibly complex. For example, GTK+ can adjust button placements to right-to-left locales, supports complex unicode rendering with some rich-text capabilities (any text can be colored, bold, italic, combine LTR and RTL scripts, etc), nearly any nesting of widgets is allowed (although putting a button inside another button doesn't make sense), and can interact with low-level features from the window manager; yet it lacks a lot of features. If all your "standard GUI" can do is show rectangular buttons inside rectangular windows, not many people will use it. – DanielKO Jul 12 '13 at 14:17
  • 1
    I think the reason is due to the sheer subjectivity when it comes to GUI, everyone to their own taste. – MathuSum Mut Apr 22 '16 at 13:59