Thread: c++ gui programming

  1. #1
    Registered User
    Join Date
    May 2009
    Posts
    242

    c++ gui programming

    i'm having major difficulties trying to set up wxwidgets for VS2010 just to create any gui at all and wonder if i'm even on the right track. is qt easier to use?

    or should i switch to a different ide? i do also have a linux machine with eclipse on it (which i think will work as a c++ ide although i've only used it for java) but generally am still more comfortable using windows and vs2010 for the moment.

    what's going to be the easiest way to start learning gui programming in c++? i've done a bit in java, and this just seems way more complicated than it needs to be getting started on it--i.e., just creating some kind of extremely basic "hello world" window for a start.

    all things being equal, i do have a wxwidgets book by smart, hock and csomor, so if there's some easy way to get it going, i'd definitely be down for sticking with what i've got if there's some way to ease the starting pains. i have the libraries installed (correctly, i think) but can't figure out what steps to take to create a window--and the book doesn't help much either for the beginner, i'm afraid.

  2. #2
    Registered User
    Join Date
    Jul 2008
    Posts
    38
    Qt has Qt Designer, it allows you create a GUI using drag and drop. Search with Google for screenshots and more information about Qt.

  3. #3
    The Autodidact Dante Wingates's Avatar
    Join Date
    Apr 2010
    Location
    Valhalla
    Posts
    56

    Angry

    Try using the win32 library and you will never think that these days gui programming is any hard...

    I personally like Qt... Its not hard, but it depends on what you call hard... Before programming a GUI using some drag n drop feature, learn how to write it without visual help... Programmers should write more than click... If you hope to continue programming in C++ and are afraid of using the keyboard, then give it up; C++ is not Java or VB

    Anyone can drag and drop these days, making a user interface, press play and voilá... But how could someone be confortable with the idea they cant program from "scratch"? Thats why I hate Java and many other languages..

  4. #4
    Registered User
    Join Date
    May 2009
    Posts
    242
    yea, i'm also not looking for drag and drop. just something that has step-by-step instructions on how to set things up and what's going on.

    so, dante, where do i find instructions on using the win32 library for gui programming?

  5. #5
    Registered User
    Join Date
    May 2009
    Posts
    106
    try this for learning the win32 Forgers... it will look REALLY difficult at first but if you spend enough time it will become a piece of cake, most ides will come with a template that has a winapi basic project started with code, so for that part of the program you just have to edit things to your needs and understand how things like the main loop work.. Also you could use the .net framework
    Last edited by jamort; 06-18-2010 at 01:58 AM.

  6. #6
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Sigh. People these days.
    Give up on Win32 programming. It's difficult and it's a headache. Not a good way to build a GUI or start programming. You will be frustrated and think GUI programming is hard. And that is because it is hard, using Win32 API. A good framework, OTOH, can be really easy.
    Designing visual GUIs is good. Because that is exactly what they are: visual. There is nothing wrong with designing GUIs visually. Indeed, it should be preferred because it makes it easier to create them and saves time.
    What you need to worry about is coding all the things that is needed to make the GUI tick. To do all the functionality.

    Aisthesis, there is nothing wrong with the IDE. It's merely the framework that's giving you headaches and no switching IDE is going to help that.
    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.

  7. #7
    System Novice siavoshkc's Avatar
    Join Date
    Jan 2006
    Location
    Tehran
    Posts
    1,246
    Quote Originally Posted by Dante Wingates
    Try using the win32 library and you will never think that these days gui programming is any hard...
    You are joking right?
    Learn C++ (C++ Books, C Books, FAQ, Forum Search)
    Code painter latest version on sourceforge DOWNLOAD NOW!
    Download FSB Data Integrity Tester.
    Siavosh K C

  8. #8
    Registered User
    Join Date
    May 2009
    Posts
    242
    ok, then, concretely here's where i'm at with wxWidgets:

    1) Download latest version and put in a directory. I did this with self-extractor so that it would be correct and have no reason to think it isn't.

    2) Following Smart et al. (Cross-Platform GUI Programming with wxWidgets), p. 547, I opened the build\msw\wx.dsw workspace. VS2010 converts it since it's a VS6 workspace. I let it convert, then click build all. First an error, but when I build again, it builds everything.

    3) Now I go to the samples\samples.dsw to try to get started. Again VS2010 has to convert, as I do. Then when I click build, there are 4 projects that just won't build, and I get an error message saying that I need to set wxUSE_GLCANVAS and wxUSE_ODBC to 1.

    4) Following the error messages and Smart, et al., p. 549, I went to include\wx\msw\setup.h and changed the definitions for wxUSE_GLCANVAS and wxUSE_ODBC to 1. Then I deleted the vc_lib and vc_dll directories (which were created during the previous builds), re-opened build\msw\wx.sln and rebuilt, then did the same for samples\samples.sln. I get 'operation succeeded' in the debug window.

    At this point (with everything apparently built correctly) I just naively clicked run from the samples workspace in the hope that I might see a window of some sort pop up (as it does when you program it in java with java.awt.*) but get an error message along the lines of unable to find the .exe file.

    Just to get started, I'd be quite happy copying some simple (or at least as simple as possible) pre-existing code that's known to work, but I think it's really a matter of getting the surroundings for the code properly set up more than writing the code (which I'm confident I can do and am eager to learn). For example, will it work just as a win32 console application?

    In appendix B of the book, there are some rather complicated instructions (p. 560) which I'm having trouble with as of step 2: Open the Project Settings/Properties dialog. I find several spots that say something about Project properties, but none of them that I found show the preprocessor definitions that apparently need to be edited according to step 3.

    The book does recommend starting out with DialogBlocks, which I think is drag and drop (never used it), but I was really hoping I could figure out how this works using the ide that i normally use, namely visual studio... (?)

    if there's anyone here who has used wxWidgets with VS and could either walk me through a few steps to get a simple window going or give me a link to an existing "getting started" that clearly describes the steps, i'd be very grateful!! Or even if there's some online tutorial for creating a really basic GUI in VS that doesn't involve wxWidgets that would presumably give me a better idea of what I need to be doing.
    Last edited by Aisthesis; 06-18-2010 at 10:10 AM.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. I need help beggining GUI prgramming in c/c++
    By draigan89 in forum C Programming
    Replies: 2
    Last Post: 04-16-2010, 09:34 AM
  2. any shareware GUI to use for Windows ?
    By Amy N. in forum C Programming
    Replies: 6
    Last Post: 07-22-2009, 01:31 PM
  3. .NET And GUI Programming :: C++
    By kuphryn in forum C++ Programming
    Replies: 4
    Last Post: 01-27-2002, 04:22 PM
  4. GUI Programming :: C++ Exclusive
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 01-25-2002, 03:22 PM
  5. C++: Reference Book, GUI, Networking & Beyond
    By kuphryn in forum C++ Programming
    Replies: 4
    Last Post: 11-10-2001, 08:03 PM