Gui Library Suggestion

Pages: 123
hey guys, i just started GUI programming today.. i learned c++ about 2 and a half months ago only with free online resources.. I previously attended two semesters of java class so i can program Swing GUI in java (minesweeper, sudoku, tictactoe, slidergame)..

The problem here is I need your suggestion on what library should I use, please base it on my experience.. i have tried Qt, wxWidget and Gtk+ just today..

i was impress on Qt and wxWidget, but Qt has more organize documentation.. also is MFC a good way to learn Windows programming?

please add your reason why chose your preferred library..

~thanks
Well, I would say 21/2 months isn't really long enough; but if you really want to try, then try using Qt. It's really powerful, especially against living things.
yes.. i have i tried Qt.. i kinda wonders me.. it is dependent on many dll, but i think i could statically link it.. may i ask what you do you use personally?
I don't tend to write GUIs, tbh. I hate it. I find non-interactive programs more fun to write. But I wanted to suggest Qt because some of the GUIs I've seen made with Qt were really good.
i see.. after trying Qt, i notice it's look and feel is not native.. so i kinda make a quick search and read.. and found out that it emulates the platforms look and feel.. so it's more like of a skin..

but still thanks chrisname, i'll have to wait others suggestion before making a choice..
closed account (z05DSL3A)
Why not just learn straight Windows API?
some people say that windows API is difficult.. is that true? please link me to good resources or tutorials.. i'll try it... and may i know why you prefer win API? do you use it yourself?

thanks for your reply..
closed account (z05DSL3A)
theForger's Win32 API Tutorial
http://www.winprog.org/tutorial/

I don't find Windows API difficult. As to why I prefer it, I don't see the point in using a third party library that at doesn't add any functionality other than supposedly making your effort 'cross-platform'. At best you will add a level of abstraction that to have the same functionality but more likely you will have less functionality available and end up crippling your UI.
hmmm.. thanks.. i guess your right, i also notice performance issues on these libraries. but the good thing about this is "write once, compile anywhere"

anyway, maybe i have to learn separate API's for different platforms, that's a big task.

edit:
thanks again.. Grey Wolf.. i guess i'll read and finish the tutorial you posted.. if you have more resources please don't hesitate to post it here..

edit:
gosh it's C language not C++, will it benefit to read it anyway?
Last edited on
closed account (z05DSL3A)
The Windows API is a C API. The tutorial should not give you any problems.

If you are interested, MFC is a set of C++ wrappers around most of the API but most people I know found it easier to have a grasp of how the API works before getting to grips with MFC.
any MFC links? i'll finish this tutorial anyway, it's not that long.
closed account (z05DSL3A)
I don't know of any good tutorials on MFC, I learnt from 'Programming Windows 95 with MFC' by Jeff Prosise. (Programming Windows with MFC was the last edition of the book that I know of released 1999).

You could have a look round MSDN http://msdn.microsoft.com/en-us/library/d06h2x6e(VS.80).aspx

The main problem is that Microsoft seem to be manoeuvring new developers towards the .net framework, they have canned several books aimed at native coding.
I'm really with Grey Wolf on using the Windows Api directly. I love coding with it. In fact, I use it in two very different languages and they are C++ and PowerBASIC. The beauty of that is I only have really one library to work with for these two very different languages. If I want to put text in a text box (edit control) in C++ it looks like this...

SetWindowText(hWindow, "Hello, World!");

and in PowerBASIC like this...

SetWindowText(hWindow, "Hello, World!")

In case you missed it, the difference between the two is exactly one semicolon.

This business about the Windows Api being hard is a strange one I've heard too. It wasn't for me but what was hard were the various class libraries such as MFC that 'wraps' the lower level Apis.

I've thought a lot about this, that is, why some folks find one thing hard, but not another, and I've come to the conclusion that everybody's mind is wired differently. Well, maybe not everybody, but I think there are a couple different 'models' out there.

The model of mind I seem to have is that I can't take very much at all on faith. I have to completely understand the smallest detail of everything I do. When I see tens or hundreds of lines of MFC wizzard generated code I'm just dumbstruck. Can't deal with it. But then, other folks might react to that by saying Wow! Look at all that code I don't have to write! And it works too! So what I'm saying is that I think different personalities are best suited to some programming techniques.

I'd like to have more time to dabble at Linux, but I just never seem to find the time. So far though I've played around some with X directly, Motif, and GTK+. My various excursions into Linux have taught me though what a beaiutiful thing the Windows Api is. To me, its almost a sacroledge to wrap it in class libraries. By the way, the low level interfaces to the graphical subsystems of Unix/Linux are to the best of my knowledge all C based too. So what I'm saying here is that if you are enthralled by classes, OOP, and all that, then by all means use them in your C++ Windows GUI programs. That is what I do. However, in terms of the GUI interface to the Windows Api, I prefer dealing with that on its own terms, and that is through the direct C interface functions. After all, C code works rather well in C++. It was designed that way.

closed account (S6k9GNh0)
Cross platform libraries almost never cripple your UI and sometimes even help to make more complicated GUIs simple. wxWidgets is a good example of this and as it is open source, any functionality you find is lacking, you can easily add it yourself and then reuse it through out your program. The reason to code directly with WinAPI is to remove any overhead given from the extra functionality provided by the library. I'd like to see you try and code something directly with X11. Good luck with that, creating a window is complex enough for at least four "Bang head on wall here" posters.
Last edited on
+1 to computerquip. Crossplatform APIs are the way to go, IMO.

I'm a huge fan of wxWidgets, although it does add quite a bit of bloat. I have yet to actually try Qt, but I'm sure it's good too.
thank you all guys, but i think this is not yet resolve.. i'm still open for suggestions.

hey Disch i tried to make a frame with a single button using wxWidgets but how come it does not have my OS's look and feel. i'm on windows xp but the button looks like classic.

any ideas?

edit:
i also tried making the same GUI in Qt. it has the look and feel of my OS but it depends on a large size dll about 100mb, after reading for a while i learned that Qt emulates platform look and feel.
Last edited on
AFAIK, wx uses WinAPI, so it should have the native look and feel.

A quick search of the website brought up this:

http://wiki.wxwidgets.org/FAQ#Why_does_my_app_take_a_Windows-95-like_look_on_Windows_.3F

Looks like various links to other forum posts about the same topic.

Basically it looks like you need to include some kind of manifest file.

EDIT:

here's a more direct link to a solution:

http://wxwidgets.org/docs/faqmsw.htm#winxp
Last edited on
hey thanks for the reply, i'll try this when i got home.. (im at school)

how come you didn't notice this problem? you've been using wxWidget right?
I was on Win2k, so I never noticed.
i see.. so you're still using win2k instead of xp or higher?

anyway, keep your suggestions coming guys..
Pages: 123