GUI Programming...

This is a discussion on GUI Programming... within the C++ Programming forums, part of the General Programming Boards category; Hi everyone... I have a question regarding C++ GUI Programming... Well, I'm a newbie to C++ GUI Programming, I know ...

  1. #1
    Registered User
    Join Date
    Jul 2008
    Posts
    44

    GUI Programming...

    Hi everyone... I have a question regarding C++ GUI Programming...

    Well, I'm a newbie to C++ GUI Programming, I know something... a little bit... -_+
    Hmmmmm, at least I've read about the "window's skeleton" thing, but as I go further, it starts to get more confusing....

    Hmmmm... before I started programming with C/C++, I used to program with Visual Basic 6.0... And I found that it's easy for me to make GUI programs with it... But, like most people say, they say that it would be better if I make my self acquainted and master C/C++ and make it my habit to program with C/C++ most of the time...

    So far, I know how to make console programs with C/C++... ;D

    But, moving to C++ GUI Programming, is it really that tough? -_+

    Hmmmm, in Visual Basic 6.0, I know how to work with GUI Applications (not that much... -_+)... Say, you want to to prompt something like a message box to the user if he/she presses a command button, then it's like this:

    Code:
    Private Sub Button1_Click()
             MsgBox "Hello, world"
    End Sub
    ..or something like changing the properties of a form control at press of a button:

    Code:
    Private Sub Button1_Click()
             Label1.Visible = True
    End Sub


    Now tell me, how am I going to do these on C++?
    Hmmmmmm, can we compare how these are done with C++ to VB6?

    Btw, my IDE is Code::Blocks IDE 8.02... It would be better if the tips/helps/advise/examples that you're going to give me are much applicable to the IDE that I'm using... Thanks in advance... ^.^

  2. #2
    Registered User carrotcake1029's Avatar
    Join Date
    Apr 2008
    Posts
    398
    I would strongly suggest you take a look at this tutorial:
    http://www.winprog.org/tutorial/

    C++ is nothing link visual basic. All the objects on your form will have callback functions in order to know what has happened with them. If you can understand that tutorial, you should at least be to the point where you can understand pretty much what is going on.

    Visual Basic hand feeds everything to you, whereas many other languages you need to call some sort of API in order to create some type of GUI.

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,586
    You might check into learning C#. Given your current background in VB I think you will find the transition very easy. C++ GUI applications are not for the faint of heart and are difficult even for seasoned programmers.

    There are 3rd party C++ APIs that will assist with GUI but with the advent of C# I think learning them would be a moot point.

  4. #4
    Frequently Quite Prolix dwks's Avatar
    Join Date
    Apr 2005
    Location
    Canada
    Posts
    8,046
    If you want to stick with C++, however, you might consider looking into the GUI library wxWidgets.
    dwk

    Seek and ye shall find. quaere et invenies.

    "Simplicity does not precede complexity, but follows it." -- Alan Perlis
    "Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
    "The only real mistake is the one from which we learn nothing." -- John Powell


    Other boards: DaniWeb, TPS
    Unofficial Wiki FAQ: cpwiki.sf.net

    My website: http://dwks.theprogrammingsite.com/
    Projects: codeform, xuni, atlantis, nort, etc.

  5. #5
    Registered User
    Join Date
    Jul 2008
    Posts
    44
    You might check into learning C#. Given your current background in VB I think you will find the transition very easy. C++ GUI applications are not for the faint of heart and are difficult even for seasoned programmers.

    There are 3rd party C++ APIs that will assist with GUI but with the advent of C# I think learning them would be a moot point.
    I have tried C#, but kinda didn't like it because programs that are written with C# needs to have the .NET Framework installed prior to running it...

    But, if you know a way on how am I going to make these programs written with C# run without the .NET Framework, then please, feel free to share... -_+

    IDE that I use for C# - SharpDevelop... ^.^

    If you want to stick with C++, however, you might consider looking into the GUI library wxWidgets.
    wxWidgets? hmmmm, does Code::Blocks have that? I think so, but don't know yet how to use it... Maybe later if you let me know how... -_+


    Thank you very much for all of you!! ^_^

  6. #6
    Registered User
    Join Date
    May 2006
    Posts
    903
    I don't think Code::Blocks has wxWidgets installed but I do think it has a project wizard for it however (just like it has one for SDL, OpenGL (which usually comes with your compiler), GLUT, Irrlicht, Ogre ...)

  7. #7
    Registered User
    Join Date
    Jul 2008
    Posts
    44
    Hmmmmm, just browsed the internet, checked my Code::Blocks IDE, and found that Code::Blocks 8.02 doesn't have the wxWidgets yet, although, there's a wizard there to make a wxWidgets project, wxWidgets isn't yet integrated to Code::Blocks, so I have to download wxWidgets to integrate it with Code::Blocks....

    Check this out:
    http://www.speakingx.com/blog/2008/0...xwidgets-setup

  8. #8
    Registered User
    Join Date
    Nov 2005
    Posts
    673
    You can use C# and just put the .NET runtime redistributable with it if you want someone else to use your software. Also, if people have their computer updated then the .NET runtime will already be on there. The main thing is if you use Visual C#(microsoft) then they will also need the Visual C# runtime.

  9. #9
    Captain Crash brewbuck's Avatar
    Join Date
    Mar 2007
    Location
    Portland, OR
    Posts
    7,160
    Quote Originally Posted by carrotcake1029 View Post
    I would strongly suggest you take a look at this tutorial:
    http://www.winprog.org/tutorial/

    C++ is nothing link visual basic. All the objects on your form will have callback functions in order to know what has happened with them. If you can understand that tutorial, you should at least be to the point where you can understand pretty much what is going on.

    Visual Basic hand feeds everything to you, whereas many other languages you need to call some sort of API in order to create some type of GUI.
    I don't know about that... Visual Basic has all the guts of any other language, it's just that Microsoft's IDE manages to successfully hide almost all of it from you. A VB app written from scratch might look quite a bit like a managed C++ app...
    Code:
    //try
    //{
    	if (a) do { f( b); } while(1);
    	else   do { f(!b); } while(1);
    //}

  10. #10
    Registered User carrotcake1029's Avatar
    Join Date
    Apr 2008
    Posts
    398
    Quote Originally Posted by brewbuck View Post
    A VB app written from scratch might look quite a bit like a managed C++ app...
    But who honestly does that :P

  11. #11
    Registered User
    Join Date
    Jul 2008
    Posts
    44
    You can use C# and just put the .NET runtime redistributable with it if you want someone else to use your software. Also, if people have their computer updated then the .NET runtime will already be on there. The main thing is if you use Visual C#(microsoft) then they will also need the Visual C# runtime.
    How? I don't even know where these .NET Runtime Redistributable are located...

  12. #12
    a_capitalist_story
    Join Date
    Dec 2007
    Posts
    2,641
    Heard of Google?

  13. #13
    Registered User
    Join Date
    Apr 2006
    Posts
    137
    Qt is a nice toolkit as well.
    There are some Qt GUI tutorials that make it look easy. One of them shows you how to make a splash screen and also how to install Qt on Windows.
    ★ Inferno provides Programming Tutorials in a variety of languages. Join our Programming Forums. ★

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Convert Windows GUI to Linux GUI
    By BobS0327 in forum Linux Programming
    Replies: 21
    Last Post: 11-27-2005, 03:39 AM
  2. .NET And GUI Programming :: C++
    By kuphryn in forum C++ Programming
    Replies: 4
    Last Post: 01-27-2002, 03:22 PM
  3. GUI Programming :: C++ Exclusive
    By kuphryn in forum C++ Programming
    Replies: 5
    Last Post: 01-25-2002, 02:22 PM
  4. C++: Reference Book, GUI, Networking & Beyond
    By kuphryn in forum C++ Programming
    Replies: 4
    Last Post: 11-10-2001, 07:03 PM
  5. GUI (Graphical User Interface) Help Needed
    By Unregistered in forum C++ Programming
    Replies: 1
    Last Post: 10-11-2001, 10:35 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21