PIGUI

T

Trevor Lango

Is it possible to write C++ GUI that is platform-independent? I just
started a class where the teacher's assignments are heavily entrenched in
the Windows API but I want to learn how to do such things with just the
language and nothing os-specific.
 
V

Victor Bazarov

Trevor Lango said:
Is it possible to write C++ GUI that is platform-independent?
No.

I just
started a class where the teacher's assignments are heavily entrenched in
the Windows API but I want to learn how to do such things with just the
language and nothing os-specific.

No such things in just the language. However, learning the language
and learning how to develop GUI are two different things. See if you
can separate them in what your teacher's providing. If you seem lost
in GUI stuff and don't recognise the language, ask him to devote some
time to explaining the language separately from platform-specific GUI.

Victor
 
?

=?ISO-8859-1?Q?Le_G=E9ant_Vert?=

Victor Bazarov wrote:

"Trevor Lango" <[email protected]> wrote...



Is it possible to write C++ GUI that is platform-independent?



No.

Ain't there any portable GUI API, like SDL ? I also know that Qt  from Trolltech can be used to produce portable GUI (read carefully the license for personal development : free of charges, but your work can then be used by Trolltech as their own)
 
B

Brian Genisio

Trevor said:
Is it possible to write C++ GUI that is platform-independent? I just
started a class where the teacher's assignments are heavily entrenched in
the Windows API but I want to learn how to do such things with just the
language and nothing os-specific.

Not many languages build GUI directly into the language. It is usually
an API that surrounds the language. Tk is an add-on to the TCL
language, and Java's AWT is an API to the language... it is just
standardized. C++ does not have anything GUI based.

Take a look at wxWindows. It is a cross-platform graphics API, similar
to MFC. It works on a number of platforms, but it does not work on all.
It also has interfaces for Python and Perl.

Also, you might look into X Windows. Though it is not natively
supported on every system, just about every OS these days (Except for
MS) ships an X server with their OS (including Mac in 10.3, so I
understand). With this limitation, there are plenty of 3rd party X
servers for Windows, including the widely popular XFree86. I have yet
to run into a user-based OS that does not have a port of XFree86.

So in short, you have options that are much more cross-platform than
MFC, but no perfect solution. The only way there would be a perfect
solution, is if all OS vendors agreed to a standard, and that will
_never_ happen :)

Bravo on trying to think about cross-platform issues. It will make you
a better programmer... hands down.
Brian
 
J

Jeff Schwab

Le said:
Ain't there any portable GUI API, like SDL ? I also know that Qt from
Trolltech can be used to produce portable GUI (read carefully the
license for personal development : free of charges, but your work can
then be used by Trolltech as their own)

It certainly is possible to write a GUI with a long list of supported
platforms. However, that doesn't make it "platform independent." The
closest thing I know to a "platform independent" GUI library is Java Swing.
 
C

Christopher Benson-Manica

Le Géant Vert said:
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

If there's a way for you to avoid posting in HTML, by all means please
avail yourself of it. I for one will thank you.
 
V

Victor Bazarov

(a) Please don't post HTML
(b) The ones you mentioned are _portable_, not platform-independent.

Victor
--
Please remove capital A's from my address when replying by mail

Victor Bazarov wrote:

Is it possible to write C++ GUI that is platform-independent?


No.

Ain't there any portable GUI API, like SDL ? I also know that Qt from
Trolltech can be used to produce portable GUI (read carefully the license
for personal development : free of charges, but your work can then be used
by Trolltech as their own)
 
V

Victor Bazarov

Jeff Schwab said:
It certainly is possible to write a GUI with a long list of supported
platforms. However, that doesn't make it "platform independent." The
closest thing I know to a "platform independent" GUI library is Java
Swing.

Wrong. Java Swing is a single-platform GUI. The platform is Java.

Victor
 
T

Trevor Lango

Le Géant Vert said:
Victor Bazarov wrote:
Is it possible to write C++ GUI that is platform-independent?

No.
Ain't there any portable GUI API, like SDL ? I also know that Qt from
Trolltech can be used to produce portable GUI (read carefully the license
for personal development : free of charges, but your work can then be used
by Trolltech as their own)

I have been teaching myself some Qt, unfortunately, my assignments are then
not coded how my teacher expects. Regards to Trolltech licensing, I don't
think they're going to be too interested in my "hello world" programs... ;-)
 
J

Jeff Schwab

Victor said:
Swing.

Wrong. Java Swing is a single-platform GUI. The platform is Java.

Victor

In what way does that make me wrong? I didn't say Swing was a
cross-platform, I said "the closest thing I know to a platform
independent GUI library is Java swing." The Java platform is supported
on a number of different hardware/OS configurations.


Btw, Swing isn't a GUI, it's a set of classes for building GUI's.
 
V

Victor Bazarov

Jeff Schwab said:
In what way does that make me wrong? I didn't say Swing was a
cross-platform, I said "the closest thing I know to a platform
independent GUI library is Java swing." The Java platform is supported
on a number of different hardware/OS configurations.


Btw, Swing isn't a GUI, it's a set of classes for building GUI's.

I apologise for sounding harsh. However, if Java Swing only exists on
(or for) one platform (which you don't deny), how can it be "the closest
thing" to a "platform independent" GUI library? Think about it.

Victor
 
J

Jeff Schwab

Victor said:
I apologise for sounding harsh. However, if Java Swing only exists on
(or for) one platform (which you don't deny), how can it be "the closest
thing" to a "platform independent" GUI library? Think about it.

Swing's platform lives on top of other platforms. Swing is largely
independent of the underlying platform. The fact that it drags a
secondary platform (Java) around with it doesn't change that, it just
makes Swing a very heavy-weight solution to the need for a GUI library.
 
V

Victor Bazarov

Jeff Schwab said:
Swing's platform lives on top of other platforms. Swing is largely
independent of the underlying platform. The fact that it drags a
secondary platform (Java) around with it doesn't change that, it just
makes Swing a very heavy-weight solution to the need for a GUI library.

Well, excuuuuse me, but then MFC is just as good a solution, you only
need a Windows simulator to exist on your "underlying" platform, don't
you? That's not platform independence.

Victor
 
J

Jeff Schwab

Victor said:
Well, excuuuuse me, but then MFC is just as good a solution, you only
need a Windows simulator to exist on your "underlying" platform, don't
you? That's not platform independence.

Victor

Java VM's are a good deal more plentiful and portable than "Windows
simulators supporting MFC." :)
 
J

Jeff Schwab

Is it possible to write C++ GUI that is platform-independent?

Java VM's are a good deal more plentiful and portable than "Windows
simulators supporting MFC." :)

In fact, you could just create native objects to represent GUI code
built from Swing. There are plenty of native compilers now. That's
about as close as one can get to platform indepence, I think.
 

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

No members online now.

Forum statistics

Threads
474,159
Messages
2,570,879
Members
47,416
Latest member
LionelQ387

Latest Threads

Top