Add GUI to C++

help

  • (2 Pages)
  • +
  • 1
  • 2

23 Replies - 6961 Views - Last Post: 22 February 2011 - 07:32 AM

#1 TamaraA  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 31-October 10

Add GUI to C++

Posted 01 November 2010 - 12:32 AM

Hello coders!

I am new here, but I am certainly not new to C++ :). I've been studding it and the concepts of programming for years now in college, and I've made many projects on my own. Now, this may sound a little strange for someone who says that knows programming, but I never actually learn how to take C++ graphic. None of my projects had a GUI interface. They never thought us that in school, so now when I am finished I am a little confused. Searching google made me even more confused. So, how can I do that? How can I add buttons, images, how can i make the program more user friendly? And what if I want to make a simple(in terms of graphic) game?

Thanks for you answer in advance.

Is This A Good Question/Topic? 0
  • +

Replies To: Add GUI to C++

#2 JackOfAllTrades  Icon User is offline

  • Saucy!
  • member icon

Reputation: 6110
  • View blog
  • Posts: 23,670
  • Joined: 23-August 08

Re: Add GUI to C++

Posted 01 November 2010 - 03:35 AM

Look into one of the available frameworks, depending on your platform. If you're on Windows, when the Win32 API is the standard, or you could use C++/CLI (C++ .NET) and use Windows Forms or WPF. Then there's Qt or wxWidgets, or any of a number of other minor ones for other platforms (as well as Windows).
Was This Post Helpful? 1
  • +
  • -

#3 oscode  Icon User is offline

  • D.I.C Regular

Reputation: 109
  • View blog
  • Posts: 257
  • Joined: 24-October 10

Re: Add GUI to C++

Posted 01 November 2010 - 04:06 AM

I agree with JackOfAllTrades' suggestions, but would advise you to try Qt and avoid C++/CLI like the plague.
Was This Post Helpful? 2
  • +
  • -

#4 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5936
  • View blog
  • Posts: 12,862
  • Joined: 16-October 07

Re: Add GUI to C++

Posted 01 November 2010 - 04:23 AM

I also quite like Qt. There are many, though: GTK, wxWidgets, etc.

If you want .NET, avoid C++ NET; it's a horrid bastardization that can only marginally be called C++. For .NET, I prefer C#. It's the language they made for the framework and not the awkward retrofitted solutions the other main languages feel like.

For Windows native C++, there's still MFC and even WIN32, in addition to Qt and other wrapper frameworks. But on Windows, you might as well just go .NET for GUI if you goal is just Windows.
Was This Post Helpful? 2
  • +
  • -

#5 TamaraA  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 3
  • Joined: 31-October 10

Re: Add GUI to C++

Posted 01 November 2010 - 09:19 AM

I am not familiar with C#, so I will have to stick with C++. I checked this Qt and right now I know nothing about it, but I will start reading right now. You see guys, my goal is to create a more or less, text based game(with some animations), and put in on a server so people can download it and play it. Do you maybe think I should quit this idea, and make an online flash game instead?I mean in terms that I know nothing about Qt so I should start from scratch and it will probably take longer. What do you think?
Was This Post Helpful? 0
  • +
  • -

#6 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5936
  • View blog
  • Posts: 12,862
  • Joined: 16-October 07

Re: Add GUI to C++

Posted 01 November 2010 - 10:44 AM

Text games are pretty basic. For happy graphic moving thingies, you'll need some kind of graphics mode, though.

As stated, C++ is your language of choice. Otherwise, I'd probably go with Java for ease of distribution and nominal graphics needs.

If you go with Qt, I'd recommend using Qt Creator as an IDE. It's free and will get you up and running quickly. It's also probably the best free IDE I've ever used.
Was This Post Helpful? 2
  • +
  • -

#7 nirvanarupali  Icon User is offline

  • D.I.C Stomach
  • member icon

Reputation: 13
  • View blog
  • Posts: 1,119
  • Joined: 01-August 07

Re: Add GUI to C++

Posted 07 November 2010 - 12:07 PM

View Postbaavgai, on 02 November 2010 - 12:44 AM, said:

If you go with Qt, I'd recommend using Qt Creator as an IDE. It's free and will get you up and running quickly. It's also probably the best free IDE I've ever used.


What compiler is Qt Creator is using?

I am also planning to make a cross-platform GUI apps, But I will work more on Ubuntu. I already have g++ installed.
Was This Post Helpful? 0
  • +
  • -

#8 bodom658  Icon User is offline

  • Villiage Idiom
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,123
  • Joined: 22-February 08

Re: Add GUI to C++

Posted 07 November 2010 - 08:42 PM

Qt Creator uses MinGW G++ 4.4

Qt has two versions for windows however, if you download the libraries only. There is the MinGW version and the MSVS version.

I am quite partial to Qt as it allows for very easy cross platform compatibility.
Was This Post Helpful? 0
  • +
  • -

#9 GWatt  Icon User is offline

  • member icon

Reputation: 278
  • View blog
  • Posts: 3,079
  • Joined: 01-December 05

Re: Add GUI to C++

Posted 07 November 2010 - 08:44 PM

You can get a Qt plugin for Visual Studio which will integrate Qt into Visual Studio and use the ms c++ compiler. If you get Qt Creator it will use gcc.
Was This Post Helpful? 0
  • +
  • -

#10 bodom658  Icon User is offline

  • Villiage Idiom
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,123
  • Joined: 22-February 08

Re: Add GUI to C++

Posted 07 November 2010 - 09:03 PM

Indeed, but I would definatly go with Qt Creator, as it's just plain amazing.

The MSVS plugin is very buggy, and 2010 doesn't support the help system.
Was This Post Helpful? 0
  • +
  • -

#11 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5936
  • View blog
  • Posts: 12,862
  • Joined: 16-October 07

Re: Add GUI to C++

Posted 08 November 2010 - 05:20 AM

View Postnirvanarupali, on 07 November 2010 - 01:07 PM, said:

What compiler is Qt Creator is using?


Depends are what environment you're working in. I'm in Linux, the compiler is gcc.
Was This Post Helpful? 0
  • +
  • -

#12 anonymouscodder  Icon User is offline

  • member icon

Reputation: 126
  • View blog
  • Posts: 710
  • Joined: 01-January 10

Re: Add GUI to C++

Posted 08 November 2010 - 07:48 AM

Qt is nice, but depending on what are you doing I would preffer wxWidgets because is really small.
Was This Post Helpful? 0
  • +
  • -

#13 bodom658  Icon User is offline

  • Villiage Idiom
  • member icon

Reputation: 113
  • View blog
  • Posts: 1,123
  • Joined: 22-February 08

Re: Add GUI to C++

Posted 08 November 2010 - 09:55 PM

Qt does have quite the overhead compared to some other APIs but offers for a very polished finished look (default styles or your own CSS type styles)

GTK is great for cross platform compatibility and light-weight applications, but the API features are not quite as extensive, and I'm not sure how well you can create GTK applications if you are not using an X-Windows type operating system such as Linux running the Gnome Desktop Manager.
Was This Post Helpful? 0
  • +
  • -

#14 baavgai  Icon User is offline

  • Dreaming Coder
  • member icon

Reputation: 5936
  • View blog
  • Posts: 12,862
  • Joined: 16-October 07

Re: Add GUI to C++

Posted 09 November 2010 - 05:15 AM

GTK is fun if you're programming in C. It's fascinating how they've implemented their own object system. For C++ you're going through a wrapper and sometimes it shows.

I honestly don't know how light weight I'd consider GTK. I guess it depends on what you're comparing it to. Any serious GUI library is going to be a little beefy. Particularly if it aims to be cross platform. It's a complex task, no matter how you approach it.
Was This Post Helpful? 0
  • +
  • -

#15 Aphex19  Icon User is offline

  • Born again Pastafarian.
  • member icon

Reputation: 615
  • View blog
  • Posts: 1,873
  • Joined: 02-August 09

Re: Add GUI to C++

Posted 20 December 2010 - 04:51 PM

View Postbodom658, on 07 November 2010 - 08:03 PM, said:

Indeed, but I would definatly go with Qt Creator, as it's just plain amazing.

The MSVS plugin is very buggy, and 2010 doesn't support the help system.


QT is a cool framework, but what always irritated me about it is the way it sorta removes you from the pure C++ stadard. For example, QT defines its own types such as QString etc, which always frustrates me. I dunno though, I'm just a bit stubborn i guess.
Was This Post Helpful? 0
  • +
  • -

  • (2 Pages)
  • +
  • 1
  • 2