windows GUI application

M

Mohitz

Hi,

How do you write a Windows GUI application in C++ ??

And is C++ the best language to write GUI applications in?

Thank you
Mohit
 
J

jalina

Mohitz a écrit :
Hi,

How do you write a Windows GUI application in C++ ??

And is C++ the best language to write GUI applications in?

Thank you
Mohit

No. Nowadays the best language to write GUIs is C# on Windows (assuming
MS windows) Try http://www.icsharpcode.net/OpenSource/SD/Default.aspx.

Java - which comes with swing - is another good option for making GUIs.
See http://www.netbeans.org and
http://java.sun.com/docs/books/tutorial/uiswing/. It works not only on
Windows but also in Linux and others.

C++ is good but with Java and C# you get plenty of libraries included
"out of the box" while in C++ you usually need to find the libraries
yourself, including libraries to make your GUI.

J.
 
G

Guest

Hi,

How do you write a Windows GUI application in C++ ??

You get a GUI framework, read up on how to use it and start coding.
Different frameworks do similar things differently but the basics are
all the same. An easy starting point would be to download Visual C++
2005 Express from MS homepage. Other alternatives are QT and wxWidgets.
And is C++ the best language to write GUI applications in?

If C++ is the language you know best, then probably yes. But it depends
on a lot of things, like which framework you use and what kind of
application you intend to write and how good you are at using different
languages. If you intend to write an application which is very GUI-heavy
(much GUI code and litte non-GUI code) then C# might be a good alternative
 
O

osmium

Mohitz said:
How do you write a Windows GUI application in C++ ??

You get a copy of _Programming Windows_ by Charles Petzold, and look for
tutorials to supplement that and get you started, on the net. GUI
programming involves, for most people, a new mindset.
And is C++ the best language to write GUI applications in?

Not unless you are already a pretty good C++ programmer, and I suspect that
if you were you wouldn't have asked the question. Visual Basic, C# and Java
come to mind.
 
J

James Kanze

Mohitz a écrit :
No. Nowadays the best language to write GUIs is C# on Windows (assuming
MS windows) Tryhttp://www.icsharpcode.net/OpenSource/SD/Default.aspx.

Which is fine, but who uses Windows? (Or at least, who wants to
limit themselves to Windows.)
Java - which comes with swing - is another good option for
making GUIs.
Seehttp://www.netbeans.organdhttp://java.sun.com/docs/books/tutorial/uiswing/.
It works not only on Windows but also in Linux and others.

Swing is very well designed, but Java isn't very good for
programming logic in general. Using Java for the GUI itself,
with Corba to communicate with the C++ part, is often a valid
option, however.
C++ is good but with Java and C# you get plenty of libraries
included "out of the box" while in C++ you usually need to
find the libraries yourself, including libraries to make your
GUI.

There are a number of portable GUI libraries which work with
C++, wxWidgets seems quite widespread, for example. I don't
think that that's really a problem.
 
J

James Kanze

On 2007-07-18 02:23, Mohitz wrote:
You get a GUI framework, read up on how to use it and start coding.

I'm just wondering: are there GUI libraries that can be used
other than as the application framework? Generally, when I want
a GUI, it's as some sort of plugin or dynamically loaded module;
having the GUI library take over main() just doesn't cut it.
 
P

Paul M. Dubuc

BobR said:
Lot easier to use an existing GUI library than write your own.

wxWidgets URL: http://www.wxwidgets.org

V IDE & V GUI: http://www.objectcentral.com/

FAQ http://www.parashift.com/c++-faq-lite

Here's my list:

# wxWigets (formerly wxWindows) -- the open source, cross-platform native UI
framework with eleven years of evolution behind it. http://www.wxwidgets.org/
# GTK+ http://www.gtk.org/

* GTK+ fundamentals, Part 1: Why use GTK+? (20 December 2005)
http://www-128.ibm.com/developerworks/opensource/library/os-gtk1/?ca=dgr-lnxw03WhyGTK
* GTK+ fundamentals, Part 2: How to use GTK+ (10 January 2006)
http://www-128.ibm.com/developerworks/opensource/library/os-gtk2/
* GTK+ fundamentals, Part3: How to deploy GTK+ (7 March 2006)
http://www-128.ibm.com/developerworks/opensource/library/os-gtk3/?ca=dgr-lnxw03GTK+Tools

# gtkmm - the official C++ interface for the popular GUI library GTK+.
Highlights include typesafe callbacks, widgets extensible via inheritance and
a comprehensive set of widgets. You can create user interfaces either in code
or with the Glade designer, using libglademm. http://www.gtkmm.org/
# Qt - from TrollTech. http://www.trolltech.com/products/qt/index.html
# Ultimate++ - a C++ cross-platform rapid application development suite. It
includes a set of libraries (GUI, SQL, etc..), and an integrated development
environment. Rapid development is achieved by the smart and aggressive use of
C++ rather than through fancy code generators. In this respect, U++ competes
with popular scripting languages while preserving C/C++ runtime
characteristics. http://www.ultimatepp.org/
# Gideon Designer - an innovative GTK+ GUI building tool. Gideon is free
software distributed under the terms of GPL license.
http://gideon.sourceforge.net/
# Other GUI Tool Kits http://www.atai.org/guitool/
 
D

duane

I'm just wondering: are there GUI libraries that can be used
other than as the application framework? Generally, when I want
a GUI, it's as some sort of plugin or dynamically loaded module;
having the GUI library take over main() just doesn't cut it.


Not sure what you mean. I think it has to do with the
event loop that is generally required.

We use Qt. It doesn't "take over"
main. I do have a main window that is created and shown in
main. Is this what you mean?

#include <QApplication>
#include "DBMain.h"

int main( int argc, char ** argv )
{
QApplication app( argc, argv);
DBMain mainform;
mainform.show();
app.connect( &app, SIGNAL( lastWindowClosed() ), &app, SLOT( quit() ) );
return app.exec();
}

Or are you referring to the instantiation of
QApplication? This is needed for the
event loop. Is this what you mean?
 
J

jalina

James Kanze a écrit :
Which is fine, but who uses Windows? (Or at least, who wants to
limit themselves to Windows.)


Swing is very well designed, but Java isn't very good for
programming logic in general. Using Java for the GUI itself,
with Corba to communicate with the C++ part, is often a valid
option, however.


There are a number of portable GUI libraries which work with
C++, wxWidgets seems quite widespread, for example. I don't
think that that's really a problem.

Yes sticking to GUI, this may be true. Nevertheless when you make a GUI
application, you often need a lot of other things. But the ones on C++
are either incomplete, either they offer poor support. If you want the
best you have to take from there and from there and from there....

I worked on a desktop application relating to finance in java: I had out
of the box large support for: strings and localization (Locale,
formatting including dates and currencies), dates (Calendar,
GregorianCalendar), plenty of GUI components, database access (JDBC).

I could also access internet (URL, Http API related, etc. and solution
for security issues included). Logging is so easy. When I left the
project, they were switching to java 6 and started using the light
database included in it.

I did not used that, but there is also API for image processing, many
many many APIs for processing XML in all forms and so on.

Of course all this using the free netbeans IDE which helps a lot in GUI
design, and MUCH MORE (see a guided tour of netbeans 5.5 or 6.0 and you
get the point - at least a very small point)

I wish wxWidget, which also have lot of libraries included - still i
doubt it has as much as Java - had a good IDE (as good as Netbeans)

Of course, all I said for java tends to be true for C# too (with Visual
Studio) but works only on Windows.

J.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,291
Messages
2,571,453
Members
48,132
Latest member
AnneHarpur

Latest Threads

Top