4

From the answers recieved for the question here: Graphics using Standard C++ only?

Seems to be that C++ itself does not have GUI functionality. So how do other Frameworks like Qt which support GUI in C++ do that? Do they use some other language internally or is there some other standard lobrary/protocol for GUI?

And I am concerned about the C++ language frameworks only.

Thank You.

Community
  • 1
  • 1
Cool_Coder
  • 4,888
  • 16
  • 57
  • 99
  • They use the native UI systems (Gnome, Cocoa, Win32). – trojanfoe Mar 25 '13 at 09:32
  • 4
    There's a difference between 'does C++ have any built in GUI support' and 'can C++ call 3rd party libraries which give GUI support'. The answer to the first is no but the second is yes. Ultimately GUI support relies on the abilities of the underlying operating system. And C++ is perfectly cabable of using that. – john Mar 25 '13 at 09:32
  • See this [How does Qt draw its GUI Components ( Basic Idea )?](http://stackoverflow.com/questions/24584189/how-does-qt-draw-its-gui-components-basic-idea) . – CodeMan Jul 09 '14 at 09:45

1 Answers1

10

They call operating system APIs, or APIs in other frameworks, in order to create GUI components.

Eg. on Windows they call the Windows CreateWindow API to create a window.

Where a framework works on multiple platforms, it contains different GUI code for each of those platforms, calling CreateWindow on Windows or whatever the Mac equivalent is on a Mac, for example.

RichieHindle
  • 272,464
  • 47
  • 358
  • 399
  • Thanks man! Now just a small query, I know Qt. But is there any other framework/library which is as good as Qt & as generous licensing like LGPL & at the same time is cross-platform? – Cool_Coder Mar 25 '13 at 09:41
  • 1
    That's quite a subjective question :-) but wxWidgets and GTK+ are two possibilities. – RichieHindle Mar 25 '13 at 09:45
  • @MagnusHoff yes I do! That is why I was asking an alternative to Qt. – Cool_Coder Mar 25 '13 at 09:52
  • @RichieHindle compared to Qt, how would you rate wxWidgets & GTK+? – Cool_Coder Mar 25 '13 at 09:53
  • 1
    @Cool_Coder: I've only ever tinkered with these three (my professional GUI experience is mostly with MFC and Windows Forms). They're all stable, mature and featureful. See this: http://wiki.wxwidgets.org/WxWidgets_Compared_To_Other_Toolkits (and other pages like it) for comparisons. – RichieHindle Mar 25 '13 at 09:57