Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm interested in developing GUI-based Windows applications in C++, but I'm not sure how it's done in professional or large-scale settings. It seems it would take a lot of development time to describe all the elements (e.g., dimensions and such) within code.

Presumably it's not all done visually, right? How is it normally done? What methods are used to prevent a lot of time wasted on defining each and every property a UI control might have?

share|improve this question
Visual Studio for C++ supports visual design of the User Interface. – Robert Harvey Feb 13 '12 at 6:42
@David It depends. For example VC++ uses resource files for the forms. – Searock Feb 13 '12 at 7:13
Don't ever let setting X,Y,CX,CY even cross your mind. All modern frameworks (even WinForms, though Qt still superior) allow defining relative layout. It's easier to write in code and actually usable. Setting coordinates is going to explode immediately when the user chooses bigger font (for which Windows have global setting). – Jan Hudec Feb 13 '12 at 9:45

Qt and wxWidgets allow you to either layout elements with an editor or with code. Like most modern guis it uses layout sizers, so instead of specifying the exact pixel coordinates of each element you just say that things are grouped into vertical sets within horizontal sets within vertical ... rather like HTML

This is necessary when you are programming for different platforms with different size controls and for mobile platforms with different sized screens and for different languages with different word lengths

share|improve this answer
It's a problem even on one platform in one language, because users can still change settings like font size and face. – Jan Hudec Feb 13 '12 at 9:29
@JanHudec: ... or just resize the application window. – sleske Mar 16 '12 at 11:46
@sleske: You can prevent resizing window in the design. True, users will doubt your sanity, but even Microsoft often does. Well, not that Microsoft was an example of good UI designers. – Jan Hudec Mar 16 '12 at 11:56

Most modern GUI frameworks use some kind of interface description language, basically a domain-specific language, to describe the GUI.

Qt has QML, Windows Presentation Foundation has XAML, Gnome uses Glade XML files, and so on.

Most of the modern web development frameworks are also declarative (Java Server Faces, ASP .NET), not only because they are based on HTLM (which is declarative), but also because they use pre-made components which are referenced by name in the page.

Many of these frameworks also have visual GUI designers, but many developers prefer to write the GUI in an editor, because it gives better control. At the same time, declarative GUI code is much less verbose than creating GUI widgets in code.

See e.g. this question for examples of declarative GUI languages:

share|improve this answer

Nope, I am afraid that they are designed using code not visually. If you want visual development check out WinForms for C# etc.

There are things like wxFormDesigner for wxWidgets by they tend to produce sub-optinum code not suitable for professional commercial deployment.

share|improve this answer
Visual Studio for C++ has had visual design of the UI since, well basically, forever. That's one reason it was called Visual Studio. – ChrisF Feb 13 '12 at 10:22

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.