Sign in to follow this  
Muhammad Sabry

The best GUI

Recommended Posts

[b]Hello everybody...[/b]

I'm a beginner C++, I've been already coding for console,but now I think it's the time to move to window application,
So my question is [b]What is best GUI and why?[/b]
i've been searching on the web and I found (MFC, QT, wxWidgets), but I really don't know which one to choose.
So HELP ME PLEASE.[img]http://public.gamedev.net//public/style_emoticons/default/sad.png[/img]

[i]Note:
I'm for sure wanna be a games programmer at the end. [/i]

[b][i]Thanks[/i][/b]

Share this post


Link to post
Share on other sites
best GUI for what ?

What platform(s) ?
Game or Desktop Application ?

Both QT and wxWidgets are good Desktop GUI APIs (QT is also good for Symbian/Meego mobile apps), i personally prefer QT but you're likely to find alot of people here who prefer wxWidgets aswell, look at some example code for them and pick the one that seems easiest to start with. (Switching API is fairly trivial anyway)

I'd recommend against MFC as it is:
1) Crap
2) Not included with the express edition of Visual Studio
3) Crap

If you are going to make games rather than GUI applications then something like SFML or SDL will be a better option.

You can also use plain old Win32 if you restrict yourself to the Windows platform, its good enough for simple stuff or you can go the .Net route and use WinForms (Which is pretty darn awesome but you probably want to swtich to C# then)

Share this post


Link to post
Share on other sites
[size=3][font=arial,helvetica,sans-serif]There is no good answer to this question.

QT is pretty awesome, but, it extends C++ with some custom keyword and constructs.
MFC causes brain damage, avoid at all costs.[/font][/size]

[left][size=3][font=arial,helvetica,sans-serif][color=#282828]wxWidgets I am not very familiar with.. but they should be more C++like.. the other options I can suggest are:[/color][/font][/size][/left]


[left][size=3][font=arial,helvetica,sans-serif][color=#282828]GTK+. Never used it, can't comment.[/color][/font][/size][/left]
[left][size=3][font=arial,helvetica,sans-serif][color=#282828]Microsoft CLI/C++ managed c++ however they call it. I did use an it is not that bad.[/color][/font][/size][/left]
[left][size=3][font=arial,helvetica,sans-serif][color=#282828]But seriously, for GUI application you should stick to C# .NET/MONO and, if you really want, your logic in C++.[/color][/font][/size][/left]

Share this post


Link to post
Share on other sites
[quote name='SimonForsman' timestamp='1330351314' post='4916986']
best GUI for what ?

What platform(s) ?
Game or Desktop Application ?
[/quote]

1- best GUI for window programming. if I understood your quesition.
2- I know that mfc is for MS windows, and eather qt or wxWidget is a cross plateform, which make them in higher position than mfc.
3- Desktop Applications, but sooner or later I will start programming for games.
Thanks

Share this post


Link to post
Share on other sites
C++ is a terrible language for GUI design and implementation.

I second C#. The WinForms editor is stupid easy to learn and gives you a lot of power with minimal investment. C# is not hard to learn and is also easy to bind to C++ if you need the raw speed. (Hint: you may think you do, but you don't.)

There's also Java which has a similar flavor to C#, but Java is a meh language at best, and the UI toolkits are a nightmare to work with for nontrivial designs. Unless you need Java or can use something like Android's UI toolkit, I wouldn't bother.

If you're on a Mac, the Interface Builder/Cocoa combination is about as close as you'll get to WinForms. Almost as good but not quite, and you have to use Objective C and Xcode, which are not exactly great (well, Xcode is more the problem than Objective C, frankly).


Just in case the basic trend hasn't become apparent: don't use C++ for UI implementation if you can possibly avoid it.

Share this post


Link to post
Share on other sites
I would also second Qt, I think it's fantastic. There is also an extensive library available at your disposal. See: http://doc.qt.nokia.com/5.0-snapshot/qtcore.html Qt is perfectly fine for desktop programs, you will want to look into QtCreator as well if you choose to use it.

Share this post


Link to post
Share on other sites
Muhammad: I have merged your two threads into a single discussion (previously there was one copy in Game Programming and one in General Programming). In the future, please do not post multiple copies of the same topic in different forums.

Thanks!

Share this post


Link to post
Share on other sites
[quote name='ApochPiQ' timestamp='1330370878' post='4917109']
Muhammad: I have merged your two threads into a single discussion (previously there was one copy in Game Programming and one in General Programming). In the future, please do not post multiple copies of the same topic in different forums.

Thanks!
[/quote]

I'm sorry for doing that, it's just I didn't see the General programming section at the first. So I'm sorry again,and thanks for the merging.

Share this post


Link to post
Share on other sites
I never coded a single bit of C# in my life, however I do have quite some experience with GUI coding (in C++) using wxWidgets, which I think totally rocks. But since I can't compare from own experience: what makes coding GUIs in C# a better choice over C++ with wxWidgets?

Share this post


Link to post
Share on other sites
[quote name='Malc0lm' timestamp='1330447674' post='4917425']
I never coded a single bit of C# in my life, however I do have quite some experience with GUI coding (in C++) using wxWidgets, which I think totally rocks. But since I can't compare from own experience: what makes coding GUIs in C# a better choice over C++ with wxWidgets?
[/quote]

the simple fact that you can use a language that has the constructs needed for nice event handling built in the language itself (ie. delegates) as opposed to a language where these constructs have to be simulated using preprocessing hacks (QT) or some other convoluted system simply to use a member function as a callback.
Also the built in reflection and metadata in C# makes it much easier to build a visual gui editor.
But the real answer to your question is 3 clicks and 15 minutes of coding away.. that is.. download Visual C# and see yourself... it really just takes 10 minutes and a simple 1 button application (WinForm) to convince yourself there is no real comparison.

Share this post


Link to post
Share on other sites
Would a C# project also work (i.e. be compilable) for other platforms than Windows? And more specifically, does it give native controls (i.e. Windows look & feel on Windows, OS X look & feel on OS X, etc) on the supported platforms?

Share this post


Link to post
Share on other sites
[quote name='kunos' timestamp='1330451465' post='4917446']
the simple fact that you can use a language that has the constructs needed for nice event handling built in the language itself (ie. delegates) as opposed to a language where these constructs have to be simulated using preprocessing hacks (QT) or some other convoluted system simply to use a member function as a callback.
Also the built in reflection and metadata in C# makes it much easier to build a visual gui editor.[/quote]
The same goes for Objective-C/Cocoa, or [url="http://kivy.org/#home"]Python/Kivy[/url]. Of course, all these options place certain limitations on portability.

Share this post


Link to post
Share on other sites
[quote name='Malc0lm' timestamp='1330460015' post='4917492']
Would a C# project also work (i.e. be compilable) for other platforms than Windows? And more specifically, does it give native controls (i.e. Windows look & feel on Windows, OS X look & feel on OS X, etc) on the supported platforms?
[/quote]

a simple WinForm application will run, without recompiling, under Mono on lots of different platforms.

Having said that, I dont see the issue of portability raised by the OP. The typical usage of a GUI application in the game development industry is for tools, and who really cares about portability of a tool? Hardly a show stopper for these kind of applications where the main discriminant is productivity and robustness, and rightly so.

Share this post


Link to post
Share on other sites
I've used wx quite a lot and it's pretty good, but it will look businessy and not 'cool'. If you're making games, you maybe don't need to use a standard GUI framework at all - you might do all your GUI in-game.

A note on MFC; it sure is ugly under the hood but I actually quite like developing with it and apps will look nicer than with wx since you can access the fancy Windwos-only controls. Of course if you want to go cross-platform, not an option.

Share this post


Link to post
Share on other sites
I agree, for beginners C# forms is the way to learn. For C++ QT is very good, and it supported by all major platofrms; even mobiles. GTK+ is quite good, but more lower level and harder to understand at the beginning. With these GUI APIs you can create some really useful tools, which will aid you in the future when you develop games (making your own game editors, etc).

Get to grips with raw C++; bare in mind as ApochPiQ mentioned isn't GUI development friendly. So write some console apps, and when you are ready and you have covered not only C++ programming; you have also learned the structure of a program. Once you get to writing GUI applications, knowing about message queueing, events, input, GUI interaction will come with patience and most importantly persistance.

Agree with the previous posts MFC is absolutely terrible, do not bother. I've heard good things about WX as well. To be honest, there are plenty of alternatives; These GUI's are good bases to learn when you are ready. Just to add, a lot of in-game menus (HUDs) and GUI are usually done with [url="http://www.cegui.org.uk/wiki/index.php/Main_Page"]Crazy Eddie's GUI[/url], which not only uses C++, but also easier languages like C#, Python, and many more . Look at the video demos for now, once you get more acclimatised to more graphical programming, remember it and give the code examples a try.

Share this post


Link to post
Share on other sites
IMO, the best GUI is one you roll for yourself.

I have a GUI system in place for my own app that I am working on. Rolled it in less than a day. There is nothing that I can't do with it. So, it is good for what I want (currently games programming).

Share this post


Link to post
Share on other sites
I too think Qt is great, and use it for Windows, Linux and Symbian. (Have no experience of WxWidgets to compare though.) You can even use it for game programming, which I'm doing for my current Nokia project (though for desktops, things like SDL seem more commonly used).

Isn't MFC about a decade out of date? Well personally I think it was dreadful even back then, but even if you want to do it the "Microsoft official" way, they've moved on to newer APIs (presumably with the recommendation of using C#).

It's true that Qt works with a modified C++, but it works well I find (and Microsoft have made their own modifications to C++ to get it working with managed code for their more recent APIs anyway, which in my opinion looks messier than what's done in Qt).

[quote name='lonewolff' timestamp='1330685330' post='4918544']I have a GUI system in place for my own app that I am working on. Rolled it in less than a day. There is nothing that I can't do with it. So, it is good for what I want (currently games programming).[/quote]Nothing? I'm not convinced you have anything near the full functionality of a UI toolkit in a day [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Though it is indeed possible to roll something good enough for a simple game.

It depends what the OP is asking for. If he wants to make graphical games, then the next stop is not a GUI toolkit - or indeed, a GUI at all. He's better off learning writing simple games before worrying about that. If he is asking about non-game applications, then he is certainly better off learning to use a standard GUI toolkit.

Share this post


Link to post
Share on other sites
[quote name='Malc0lm' timestamp='1330447674' post='4917425']
I never coded a single bit of C# in my life, however I do have quite some experience with GUI coding (in C++) using wxWidgets, which I think totally rocks. But since I can't compare from own experience: what makes coding GUIs in C# a better choice over C++ with wxWidgets?
[/quote]

A bit off topic but I've coded quite a bit in both and I prefer C++ (I'm an engine programmer). I can say from experience that trying to bridge between an engine in C++ and an editor in C# is more work than I'm interested in doing. I was looking at QT for my editor, but after reading your comment about wxWidgets I am definitely going that route. Thanks for opening my eyes to more options :)

Share this post


Link to post
Share on other sites
[quote name='mdwh' timestamp='1330697903' post='4918597']
[quote name='lonewolff' timestamp='1330685330' post='4918544']I have a GUI system in place for my own app that I am working on. Rolled it in less than a day. There is nothing that I can't do with it. So, it is good for what I want (currently games programming).[/quote]Nothing? I'm not convinced you have anything near the full functionality of a UI toolkit in a day [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Though it is indeed possible to roll something good enough for a simple game.
[/quote]

Thats fine to go negative rep me mdwh. But, as I said, (for the reading impaired) there is [b]nothing[/b] I can not do with it.

So, I would not have a clue what 'UI Toolkit' can do, as thus far, I have not needed a 3rd party GUI.

Its a GUI for F*#K sake, it is not that hard.

Either that or that fact that I have been coding for 23 years and trivial stuff doesn't phase me. [img]http://public.gamedev.net//public/style_emoticons/default/wink.png[/img]

Share this post


Link to post
Share on other sites
[quote name='lonewolff' timestamp='1330723173' post='4918707']
[quote name='mdwh' timestamp='1330697903' post='4918597']
[quote name='lonewolff' timestamp='1330685330' post='4918544']I have a GUI system in place for my own app that I am working on. Rolled it in less than a day. There is nothing that I can't do with it. So, it is good for what I want (currently games programming).[/quote]Nothing? I'm not convinced you have anything near the full functionality of a UI toolkit in a day [img]http://public.gamedev.net//public/style_emoticons/default/smile.png[/img] Though it is indeed possible to roll something good enough for a simple game.
[/quote]

Thats fine to go negative rep me mdwh. But, as I said, (for the reading impaired) there is [b]nothing[/b] I can not do with it.[/quote]That wasn't me. It was already negative when I read your post.

[quote]So, I would not have a clue what 'UI Toolkit' can do, as thus far, I have not needed a 3rd party GUI.

Its a GUI for F*#K sake, it is not that hard.

Either that or that fact that I have been coding for 23 years and trivial stuff doesn't phase me. [img]http://public.gamedev.net//public/style_emoticons/default/wink.png[/img][/quote]A UI toolkit will do whatever you see in Windows, basically. Listboxes, text areas (with scrolling and editing)? Tabs? A UI that dynamically positions and sizes the elements for you? Drag and drop from the OS? Multiple movable windows? I'm impressed :) Given that the OP is a beginner, I'm not sure implementing a whole UI will be quite so easy as it is for you though. And how do you make it work so your application plays nicely with Windows (i.e., appearing and behaving as a native application)?

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this