Thread: Going for a Graphical UI

  1. #1
    Registered User
    Join Date
    Aug 2007
    Posts
    85

    Going for a Graphical UI

    I'm becoming pretty bored of the plain-old console. While I was looking for portable GUIs, I went over QT and wx. there's also V, but it's damn outdated.

    QT is way over my head - and well, i've toyed around with the wx examples, but none worked. I've modified resources, paths, and in the end it looked like one library file was missing. Ah well.

    Since I am working with devc++, i found out that a RAD devc++ in a very visual basic style exists, called wx-devc++.

    Should I use that for GUI development? Forms generated with the app compile from the first try, it seems pretty easy to use, too..

    thanks

  2. #2
    Registered User kroiz's Avatar
    Join Date
    Jun 2007
    Posts
    116
    I use QT at work and it is really great, but it is not free for comerrcial use and very expensive.

    On the other hand gtk is free for comercial use (I think) and looks very attractive to me.
    I suggest you check it out.

  3. #3
    Registered User
    Join Date
    Nov 2006
    Posts
    519
    wxwidgets is really hard to get to work under windows but if it runs it is very pleasant to develop with it.

    If you are not under pressure maybe have a look at http://www.ultimatepp.org/
    its an ide and a gui toolkit and not very many programmers seems to know about it. But I've had no time to try it myself yet.

  4. #4
    Registered User
    Join Date
    Aug 2007
    Posts
    85
    Wait, this GTK is a something that will create a set of functions/libraries that will make a GUI or is a GUI? That "toolkit" word is really intriguing.

    meh, pheres. wxdevc++ has it working from the start. I drew out a bunch of buttons and "controls" and it compiled just fine. Even some code to react went fine. My problem is that I can't have a main, or I don't get the way wx apps work.
    Last edited by _izua_; 08-11-2007 at 10:32 AM.

  5. #5
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    My problem is that I can't have a main, or I don't get the way wx apps work.
    It looks like you don't get the way wx apps work. Take a look at some of the tutorials on wxwidgets.org, one of those that I found has the macro IMPLEMENT_APP implement main() for you, using wxApp child class that you write.
    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

  6. #6
    Registered User
    Join Date
    Aug 2007
    Posts
    85
    Laserlight, can't find that one. If it's no bother, let me know the url.

  7. #7
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Looking at the sidebar to the right of the WxWidgets homepage, I see a link to tutorials. The first tutorial on the list states:
    As in all programs there must be a "main" function. Under wxWidgets main is implemented using this macro, which creates an application instance and starts the program.

    IMPLEMENT_APP(MyApp)
    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
    Registered User
    Join Date
    Aug 2007
    Posts
    85
    Oh, i understood from the initial post that the macro is used inside main. And I checked all of them to find main

    Meh, this is hard. The macro says where it starts, but it doens't have curly brackets as main(). Also, I can't get it where the program is looping, to keep the window "alive" ? It's like another programming language.

    But at last, the wx examples compile

  9. #9
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    The macro says where it starts, but it doens't have curly brackets as main(). Also, I can't get it where the program is looping, to keep the window "alive" ?
    From the looks of it, IMPLEMENT_APP will create a main() function that calls OnInit() from a MyApp object. If so, you can effectively treat OnInit() as the main() function.

    It's like another programming language.
    That is what happens when you learn another programming interface.
    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

  10. #10
    Registered User kroiz's Avatar
    Join Date
    Jun 2007
    Posts
    116
    Quote Originally Posted by _izua_ View Post
    Wait, this GTK is a something that will create a set of functions/libraries that will make a GUI or is a GUI? That "toolkit" word is really intriguing.

    wikipedia page about gui toolkits

  11. #11
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    If you want to be windows specific, you should learn the Win32 API directly. If you want to be portable, learn a 3rd party portable library such as those described above. If it were me, I would learn the portable library.

  12. #12
    Registered User
    Join Date
    Aug 2007
    Posts
    85
    I'm toying with WX for a few hours, but I can't get a few widgets to work. the slider and scrollbar, for example - the compiler gives me "x is not declared" for any of their function i try to use (including getValue() which is really annoying), however, I see them in the popup menu with the class' members.

  13. #13
    Registered User MacNilly's Avatar
    Join Date
    Oct 2005
    Location
    CA, USA
    Posts
    466
    Most likey a problem with your code, not wxWidgets.

    Win32 API is as native as you can get so the code to even implement a simple window is extremely complex. Your best bet is probably what you are using, just keep experimenting.

  14. #14
    Registered User
    Join Date
    Aug 2007
    Posts
    20
    Qt is great. They are also offering an open source version. This takes a bit more setting up, but its worth it!

  15. #15
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    Quote Originally Posted by MacNilly View Post
    If you want to be windows specific, you should learn the Win32 API directly.
    I wouldn't recommend it. Even if you just want to be Windows specific, Win32 API is difficult and complex. There are many frameworks, including those for Windows only, that does a much better job at hiding the complexities of the underlying API or makes everything much easier.
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Graphical debugger for Linux
    By abh!shek in forum C Programming
    Replies: 6
    Last Post: 05-30-2008, 06:13 PM
  2. Graphical Interface in C
    By dead-eternity in forum C Programming
    Replies: 7
    Last Post: 03-10-2005, 04:10 PM
  3. Graphical standards
    By Shakti in forum Tech Board
    Replies: 1
    Last Post: 08-27-2004, 11:32 AM
  4. Resource ICONs
    By gbaker in forum Windows Programming
    Replies: 4
    Last Post: 12-15-2003, 07:18 AM
  5. C UI
    By ober in forum A Brief History of Cprogramming.com
    Replies: 2
    Last Post: 02-18-2002, 11:40 AM