Thread: User interface for C++

  1. #1
    Registered User
    Join Date
    Jan 2010
    Posts
    2

    Question User interface for C++

    What should I know to be able to make an interface with buttons and images for a program written in c++ language?

    Should I know another programming language like java or something else to be able to do it?

    thank you,
    Felipe

    Ps.: I hope you understand what I am trying to ask because my English is still improving =).

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    You could learn the interface of a GUI library such as FLTK, FOX, Gtkmm, Qt, wxWidgets, etc.
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    spurious conceit MK27's Avatar
    Join Date
    Jul 2008
    Location
    segmentation fault
    Posts
    8,300
    This is called "GUI programming", for Graphical User Interface.

    You can do it in C++. How depends on the operating system on which you want this to work. However, there are some "cross-platform" GUI libraries for C++, notably Qt, which works on windows, linux, and apple.
    C programming resources:
    GNU C Function and Macro Index -- glibc reference manual
    The C Book -- nice online learner guide
    Current ISO draft standard
    CCAN -- new CPAN like open source library repository
    3 (different) GNU debugger tutorials: #1 -- #2 -- #3
    cpwiki -- our wiki on sourceforge

  4. #4
    george7378
    Guest
    I learned using the defualt Win32 libraby with this:

    theForger's Win32 API Tutorial

  5. #5
    Registered User
    Join Date
    Jan 2010
    Posts
    2
    Which one of these languages would be the most efficient and usable for windows?

  6. #6
    george7378
    Guest
    Use Win32 - it has a great array of functions, and there are many resource editor programs to help you create your GUIs.

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Yes, the more native Windows API would be suitable if you really only want to target Windows. On the other hand, whether it is more usable depends on your point of view, and of course you will have a tougher time porting if later you decide that you want to be more cross platform. Note that these are libraries, not languages (even though sometimes learning a new library interface is like learning a new programming language).
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  8. #8
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Win32 is an ugly beast with lots of complexity and lots of headaches. If I were you, I'd still the heck away from it. Using portable libraries is usually the best, especially if they're developed for C++, since they will be much, much easier to work with.
    Although you may not get everything Windows offers out of it. It's a trade off in that sense.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  9. #9
    Registered User VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,607
    MFC is still alive and kicking and you can use it and the best part is it comes with MSVC standard. But any 3rd party API will be better than using the raw Win32 API.

  10. #10
    The Autodidact Dante Wingates's Avatar
    Join Date
    Apr 2010
    Location
    Valhalla
    Posts
    56
    screw Java(yes I hate it), you dont need a stupid copy of c++ to make a user interface... I use Qt, but I think you should first try to use win32 library...


    ps: "WINDOW"s is mainly written in C, what makes you think you need another language to write UIs?
    Last edited by Dante Wingates; 06-16-2010 at 08:31 PM.

  11. #11
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Dude. If you're using C++, then you should make use of a library that is built on C++ to make the best out of the language.
    If you're using C, then go ahead and use a 3rd party library that's built on C.
    And for that matter, you can stay with C and the stoneage with lots of security vulnerabilities if you want while we move to the future with C++.
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

  12. #12
    Grey Wizard C_Sparky's Avatar
    Join Date
    Sep 2009
    Posts
    50
    Quote Originally Posted by Bubba View Post
    MFC is still alive and kicking and you can use it and the best part is it comes with MSVC standard. But any 3rd party API will be better than using the raw Win32 API.
    May not always be the case. I like Win32 for the full control, it's more difficult, but it's worth it to me.

    I heart Win32.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. How to limit user input to a certain number of digits?
    By NewbGuy in forum C Programming
    Replies: 7
    Last Post: 05-08-2009, 09:57 PM
  2. timed user input
    By sainiabhishek in forum C Programming
    Replies: 4
    Last Post: 04-01-2009, 11:59 AM
  3. Newbie Help: Currency Converter
    By Ashfury in forum C Programming
    Replies: 10
    Last Post: 11-06-2005, 01:21 PM
  4. TUI - Text User Interface
    By leonelmfreire in forum C Programming
    Replies: 2
    Last Post: 08-22-2005, 01:39 PM
  5. Non-Standard User Interface
    By Eugene in forum Windows Programming
    Replies: 1
    Last Post: 08-29-2001, 09:43 AM

Tags for this Thread