tags:

views:

502

answers:

10

Hi Fellow programmers,

I want to write a standalone GUI based app for administering one of the most popular enterprise middleware products from a very big company. But that big company already has a admin tool and its free. But guess what , its very very slow , since its written on the java/Eclipse platform.

I want to write a very fast responsive GUI tool natively for windows.

I do not have much experience programming for windows , So what library(open source preferably) i can use on windows to get the job done.

Note: I need to write it in C, Not C++ , But if i dont have any choice I guess i can do with C++. So I basically need to write a GUI app in C with some good GUI library.

Please help me out.

Thanks.

Edit : I do not know OOP and don't prefer using it.

Edit : So my choice is down to Win32API and Qt. my requirement is that of a simple GUI , nothing fancy. I will be using simple windows ,buttons and menus. But I may need to do some processing , which means GUI should not take up much resources. Based on this I m thinking of using Win32 API , even if I have to take the pain to hopefully satisfy the users.

+2  A: 

Why are you limiting yourself to C? Windows Forms and WPF and SIlverLight are all viable UI frameworks that are responsive and have tons of books. There's a reason you can't find much info about writing GUI apps in C - people don't do it.

No Refunds No Returns
Hmm i was afraid of it. So i guess i have to use C++ or something similar.Would be cool though if you could write a GUI in just C.
someguy
You can write a GUI in C. It's just quite difficult these days because the frameworks aren't desgined for it.
Mark Pim
"i was afraid of it." Right there is your best reason to learn something new.
rpj
The real reason is it requires talent, and good programming. Those aren't prerequisites for the many prepackaged Duplo frameworks Microsoft releases.
Matt Joiner
+1  A: 

If you really have to use C then you can use GTK+. Otherwise, I'd suggest a C++ library like QT or wxWidgets. However, that being said I still think it would be preferable to build a .NET (Windows Forms or WPF) solution. They should provide a better UI experience than Java/Swing.

Taylor Leese
I do not want .NET because thats another layer.when I want to distrbute , I dont expect people to have .NET and I dont want my app to be dependent on .NET
someguy
I liked QT, but Do i have to do extensive OOP programming if I use it.Can I mix C and QT together?
someguy
Regarding QT, you'd basically be building a C++ application and calling your C libraries/code from it. QT was actually my first real experience with C++ years ago and the learning curve was pretty easy.
Taylor Leese
So , how much of OOP or C++ I need to know before I start using QT.QT looks good.
someguy
I don't really understand your aversion to using OOP/C++. If you're writing a C++ application it should be OO. Think of it as a learning opportunity.
Taylor Leese
Taylor : What books do you suggest i pick up for Qt?
someguy
The only one I ever read was the O'Reilly one but that was back around '02/'03. It was good enough, but probably far out of date by now unless there is a new version.
Taylor Leese
qt is awful, use gtk+ if a linux client is necessary in the future, otherwise the expense of importing all those libs isn't worth it.
Matt Joiner
+1  A: 

Most GUI toolkits are written in C++, so restricting yourself to C will limit your options somewhat. One option that is cross platform and written in C is GTK; it's originally for X, but runs on Windows as well.

edit: Of course, you could always just program directly against the Windows API (formerly know as Win32) itself. For simple GUIs, it's not too bad.

Brian Campbell
But is this GTK good enough , How is the performance?
someguy
c++ libraries are generally much more difficult to use than C libraries, i'm not a fan of OO obsessiveness either
Matt Joiner
A: 

GUI components map very well into Object oriented paradigm. Using C for GUI applications is a bad idea, I've been there and it's much more confortable to do it in an propper OO fashion with C++. Of course you can sort of do OO with C but it's ugly to say the least.

piotr
Hmm yes ic. So i was wondering if I could use QT.Is it really good. Does it produce nice responsive GUIs or do i have to use native Windows API's .
someguy
Speed would only be a concern in standard pc if you start doing 2D and 3D rendering. If you just use vanilla GUI components it's going to be much, much faster than the java app.Either QT or Gtkmm will do for Windows.
piotr
"Using C for GUI applications is a bad idea"... see www.gnome.org and www.gtk.org for why I have the opposite opinion.
mcl
What do I have to see there? I know they are implemented in C, and I think they should have been implemented in C++. There is gtkmm btw.
piotr
+1  A: 

For plain C, cross platform, native look, simple, scriptable UI, I suggest to have a look at IUP: http://www.tecgraf.puc-rio.br/iup/

Remo.D
+1  A: 

If you really want to do it in C, you could use the Win32 API. But it's hell working with it. The Object Oriented variant isn't much better either, but it takes away a bit of the pain (MFC).

TheGrandWazoo
It might take a bit of the pain away, but the pain that's left is re-used over and over again......
Skizz
Actually, you won't get much faster than native Win32 API calls. It's a big thing to learn though.
Skizz
+5  A: 

its very very slow , since its written on the java/Eclipse platform.

Are you sure that this is the reason for the application's slowness? I am no fan of Java, but before you reach any conclusion, have you made sure that writing the software in c makes it noticably faster? It could be that the application is slow for reasons that are not under the control of the GUI programmer, such as a slow database or bad network latencies.

Also, I don't mean to be rude here, but do

I want to write a very fast responsive GUI tool natively for windows.

and

I do not have much experience programming for windows

not contradict each other?

René Nyffenegger
don't "windows" and "very fast" contradict each other?
Matt Joiner
@Anacrolix...Good one :)But windows is all i have to use.. and make the app run as fast as i can on it..
someguy
@Anacrolix : Yes the gui is slow not just on my machine, but all the machines in my company..and it does not connect to database or anything.there is one more smaller uitlity(written in C). which is very fast, but cannot do complete adminitration from it.I do not have the source for it either.Hence this undertaking..btw..Java/Eclipse sucks . the IDE may be good , but its slow and frustating.Wish all IDE were written in C++/C
someguy
+4  A: 

If you want to write a C GUI app, stick to Win32 or GTK+.

Win32 is blazingly fast, and will let you access everything available to Windows. Take a look at this tutorial.

GTK+ is extremely easy to use, cross platform, and provides tons of extra functionality. Start by downloading the all-in-one bundle, and move onto a tutorial and the documentation.

Personally I'd recommend going straight to Python if you need quick, responsive GUIs, and just need to wrap some lower level stuff.

Matt Joiner
But distribution will be a problem.even if i manage to pack and make it a executable. the size has to big.NO JVMs pls..
someguy
no i don't know where you got that idea. if you use win32, you'll get the smallest possible executable. gtk+ usually requires ~8MB of DLLs to go with it, but they can be shared by all gtk+ apps. neither win32, or gtk+ is a JVM...
Matt Joiner
@Anacrolix..i was talking about Python..
someguy
@someguy, oh okay. it's not a java virtual machine tho :). more of a runtime.
Matt Joiner
+1  A: 

I strongly recommend you to use C++ with the Qt library, which is both cross-platform and open-source (LGPL). C++ Qt GUI applications are as fast as native Win32 applications, although they take more memory. And you can't even start comparing the productivity gains - Qt is a great library, terrifically designed for GUI programming with tons of other useful tools.

Eli Bendersky
A: 

In my opinion, more than the GUI frameworks you need to really work on the design of the application you building.

For a normal GUI in C/C++ Win32 provides enough of controls for a decent looking application with good response time.

What you should really focus on is how to make it multi-thread based upon the time your modules take for execution.

Consider this small example: You have a DataBase connection monitoring in your GUI which is probed every second. Another module may be sending some big files to other applications. Now if an application is single threaded, your GUI is bound to have response problem. If you database connection is very slow due to some network/db issue your app will hang irrespective of the GUI frameworks or hardware chosen, if it was a single threaded app.

But if you write a good design and dedicate a separate thread for GUI handling and other threads for handing background tasks, you will have a really good GUI response. That way you can perform other tasks in background and GUI gets updated when notification is obtained. Remember, it wont happen magically and you need to sync you threads and update GUI.

Also, avoid creating threads for each and every task. You need to check things which can take more time like sending big files or faster tasks like checking/reading if config file exists or not.

By using third party GUI frameworks you are increasing your dependencies in your application and you would require to ship additional dlls etc with you main application. With win32 things are pretty neat.

Kavitesh Singh
Yes very true..I was looking for something like this..MY gui does poll something at the backend and displays in the GUI so i definelty need thread here.Thanks for the pointers..
someguy
So my best advice is to stick with Win32 based on your constraints and design a good mulithreaded app as per your requirment.
Kavitesh Singh
Any good tutorials on writing a multithreaded GUI app for windows..something for beginners..
someguy
If you seriously wanna get into windows programming especially win32 these books should come very handy.1. Programming Windows / Charles Petzold - for understanding basic win32 applications and various GUI controls. This will give you good idea how to make a GUI application in win32.2. Programming Applications for Microsoft Windows / Jeffrey Richter - this will help you in making multi-threaded applications and explain concepts thread syncronization etc in detail so that you can design good applications.Also you can check www.codeproject.comHope this helps.
Kavitesh Singh