Re: GUI stuff

1999-03-08 Thread Joeri van Ruth
On Tue, Feb 16, 1999 at 04:24:12PM -0600, Havoc Pennington wrote:
 Gnome has two faces. From the developer's point of view it is an
 application development framework. It adds a lot of useful widgets to Gtk,
 adds some convenience functions, adds some things like configuration file
 loading/saving, adds CORBA (analagous to DCOM), adds image file loading,
 etc. This is all in the 'gnome-libs' package. 
 
 The other face of Gnome is a desktop environment and set of applications
 built using the developer's framework. However, if you use the framework
 your users are not forced to use Gnome; gnome-apt, for example, runs just
 fine without any of the desktop stuff installed. (The desktop environment
 includes a file manager like Windows Explorer, a start-menu type thing,
 etc.)

I am wondering which part of gnome-libs gnome-apt uses.  I would imagine
it to have little use for image file manipulation and CORBA, for example.
So does it use some of the added widgets?  Or configuration file management?

Joeri van Ruth [EMAIL PROTECTED]


Re: GUI stuff

1999-02-18 Thread Ole J. Tetlie
*-Kirk Hogenson [EMAIL PROTECTED]
|
| Qt is a C++ library.  (No wrappers that I know of -- it is much
| harder to wrap an OO-library, unless you're wrapping in another
| OO language...)

There are many wrappers for Qt. Since there is a C wrapper you
could also write a wrapper for almost any language.

-- 
...Unix, MS-DOS, and MS Windows (also known as the Good, the Bad,
and the Ugly).   (Matt Welsh)
[EMAIL PROTECTED]   [-: .elOle. :-]   [EMAIL PROTECTED]


Re: GUI stuff

1999-02-18 Thread Kirk Hogenson
[EMAIL PROTECTED] wrote:
 
 *-Kirk Hogenson [EMAIL PROTECTED]
 |
 | Qt is a C++ library.  (No wrappers that I know of -- it is much
 | harder to wrap an OO-library, unless you're wrapping in another
 | OO language...)
 
 There are many wrappers for Qt. Since there is a C wrapper you
 could also write a wrapper for almost any language.


I did not know that there was one, but there is indeed.  It is
called QtC.

However, it is very hard to find!  (I found it at a kde.org mirror:
ftp://ftp.tux.org/pub/sites/ftp.kde.org/devel/qt-bindings/QtC-0.0.2.tar.gz)

And, according to its author:

 Subject: Re: C interface for Qt?
 From: Roberto Alsina [EMAIL PROTECTED] - other postings
 Date: Wed, 2 Sep 1998 09:06:47 -0300 (GMT-0300)
 
  Is there a C interface for Qt somewhere?
 
 If you mean a good one, I would probably have to say no :-)
 If you just want one, there's QtC, which wraps most of version 1.33 
 but with a little effort and use of some included scripts could be 
 extended to do 1.40.
 
 It is somewhere in ftp.kde.org and probably in ftp.troll.no.
 
 It has, if my memory serves me right, a rather ugly bug in QPainter, 
 which I have no idea of how to fix, and a minor one in some place in 
 QColor that's trivial.
 
 Also the signal/slot stuff is not complete (but should be easy to 
 adapt for your needs).
 
 No reasonable way to inherit widgets or create your own.
 
 Other than that, if what you want is to create a simple GUI in C, it's 
 serviceable.


(this was found at http://www.troll.no/qt-interest/bap4.html)

Let me explain my statement: it is much harder to 'wrap' an
OO-library, unless you're wrapping in another OO language

The traditional way of creating windows/widgets/applications/etc in
a C++ GUI library is to write a new class that inherits from one
in the library.  Then, you can use all of the functions that the
window/widget/application/etc provides, and add your own.  I do
not know much about Qt, but I gather that it operates this way.
Non-OO languages generally lack the concept of inheritance, so
it must be 'faked'.

It is difficult to simulate this behavior in C (but not impossible,
you'd have to implement your own dynamic dispatch tables, I guess).
The quote above suggests that QtC has not yet solved this problem.

I certainly don't mean to flame Qt! (The events of the past year
have forced us to tread carefully when discussing pros/cons of
GUI libraries...)  From what I've seen, Qt is an excellent (if not the
best) GUI library for C++, and may one day be in C as well.  I think
KDE is a very nice desktop, it is what finally got my wife away from
Microsoft.

Personally, I program with wxGTK, since I like wxWindows.  Is Qt 
technically superior to wxWindows?  I don't know.  Both are certainly
good.  Someone (in fact, it is the same person who wrote QtC (Roberto 
Alsina, who I quoted above)) is starting wxQt, a wrapper around Qt for
the wxWindows library.  This would allow developers to sit on the fence
in the gnome-kde wars -- compiling their programs into the native 
toolkit of each.

Kirk


Re: GUI stuff

1999-02-18 Thread Havoc Pennington

On Thu, 18 Feb 1999, Kirk Hogenson wrote:
 
 good.  Someone (in fact, it is the same person who wrote QtC (Roberto 
 Alsina, who I quoted above)) is starting wxQt, a wrapper around Qt for
 the wxWindows library.  This would allow developers to sit on the fence
 in the gnome-kde wars -- compiling their programs into the native 
 toolkit of each.
 

What's really needed for that is wxGnome and wxKDE, which don't exist; 
there's a reasonably large difference between a vanilla Gtk app and a
full-blown Gnome-o-rific app. I hope the wxGtk guy will expand to Gnome
once Gnome is 1.0, and hopefully Roberto will provide KDE support in wxQt. 

BTW another reason C++ is hard to wrap is that the Gtk object system and
Gtk in general is designed especially for wrapping. It has
introspection/reflection much like Java, you can get at the internals,
replace the internals with custom internals, replace virtual functions,
etc. Unlike most OO languages, C++ (by design) does not provide any
runtime information about objects.  So if you use the C++ object system
unenhanced, you don't end up with a very wrappable system. Qt just isn't
designed with it in mind. Gtk is. I don't think this is related to C vs.
C++ as many have said; it's just a matter of what the library was designed
to do. The only C/C++ relationship is that Gtk had to implement its own
object system which encouraged features like this.

The proof is, there are a dozen or more languages with Gtk support, 
many of them interpreted languages.

Havoc





Re: GUI stuff

1999-02-18 Thread Kirk Hogenson
Havoc Pennington wrote:
 What's really needed for that is wxGnome and wxKDE, which don't exist;
 there's a reasonably large difference between a vanilla Gtk app and a
 full-blown Gnome-o-rific app. I hope the wxGtk guy will expand to 
 Gnome once Gnome is 1.0, and hopefully Roberto will provide KDE 
 support in wxQt.

I agree with this, wxGnome and wxKDE would be wonderful.  However,
I don't know if the wxGtk guy (Robert Roebling) is interested in
starting wxGnome.  He has stated that he does not want *any*
Gnome-specific code in wxGtk, so wxGnome would have to be a separate
project.

 [...] Unlike most OO languages, C++ (by design) does 
 not provide any runtime information about objects.

C++ does have run-time type information, though it is generally
considered poor style to use it.  Almost all uses of RTTI can
(and should?) be replaced by virtual function calls.  Doing so,
though, implies (as your/my snipped comments discuss) that you aren't
going to get a very wrappable library.

So, using C++ the right way (as in Qt  wxWindows) means you'll have
a hard time creating a C interface.  (Which is pretty much what you
concluded, we just got there in different ways. :)

Plus, not too many compilers fully support RTTI yet.

Kirk

PS: gnome-apt looks great!  Excellent job.


Re: GUI stuff

1999-02-17 Thread George Richard Russell

 On Tue, 16 Feb 1999, David Webster wrote:
 I am wanting to start some GUI development but I am having a hard time
 figuring out just what the GUI development is?  I see that the GTK
 libaraires are the base C++ GUI class libraries, but I also see stuff
 like Gnome and qt* and Glib, and other stuff.  Is there any online
 documentation that sorts all this stuff out?  What are the compliments
 in the Linux/X11 world to MFC/IOCL in the Win32 world?  What about
 resource editors and stuff like that???

I am a KDE user and enthusiast, so my biases are pretty obvious. I also
really 
hate C as a language :-(

Qt is a OOP library weitten for X11 and Windows (commercial version) in
C++
It provides the GUI widgets for making interfaces, and some utility
classes for various purposes.  Wrappers for other languages exist (C,
perl, python), but are not widely used or are in development.  Widgets
can be derived by standard OOP practices.

Its used as the foundation of the K Desktop Environment, which adds some
extra features such as network transparent file access.

KDE is more mature than alternatives for X11 Desktops, except the
venerable and commercial CDE using Motif.  The documentation is
excellent - see http://www.troll.no/ for the hyperlinked Qt docs, and an
O'Reilly book by Kalle Dalheimer (a KDE developer) on programming Qt is
due out soon.  The Qt license allows free use for free software
development, and Qt is widely and freely available for use by end users
free of charge.  Qt 2.0 will be released under an open-source license.

KDE is currently supplied by  3 of the 5 major Linuxes, Suse, Slackware,
Caldera L distributions, as well as FreeBSD and many minor Linux setups.
Its the default Suse and Caldera desktop.  Packages for the non
suppliers, Redhat and Debian, are available.  KDE is often added by
third party vendors who press CD's of Debian and Redhat etc. Redhat even
include it in Germany for competition against Suse, and has KDE packages
in Rawhide (their open beta system) which may be included with Redhat 6.
Corel supply it on the NetWinder.

Qt is commercially supported on a wide number of Unix systems, as well
as Win 32.
The development of KDE has been fast - about 2.5 years from start to the
second stable release.  Development copies can be obtained from daily
tar balls or by using CVS.  The makers of Qt, Troll Tech, gaurantee
binary compatibility throughout major release versions ie 1.0 to 1.999x
Qt 1.0 apps will run using Qt 1.42, the latest version (Qt 2.0 being in
beta). For an indication of the features of Qt 2, look at
http://www.troll.no/rsn.html and see if it offers what you need.

If it doesnt or won't, try lesstif (a free motif clone, motif being
defacto unix GUI library), or Tk (a GUI toolkit for tcl, widely used and
with bindings to many other languages like perl, python), fltk (very
fast, light weight toolkit), or a commercial Motif (big money!), or
Xforms (used by Lyx, a latex frontend) or gtk http://www.gtk.org/ (the
underlying toolkit of Gimp and Gnome)

HTH
George Russell


Re: GUI stuff

1999-02-17 Thread Daniel Burrows
On Wed, Feb 17, 1999 at 04:34:19PM +, George Richard Russell was heard to 
say:
 
  On Tue, 16 Feb 1999, David Webster wrote:
  I am wanting to start some GUI development but I am having a hard time
  figuring out just what the GUI development is?  I see that the GTK
  libaraires are the base C++ GUI class libraries, but I also see stuff
  like Gnome and qt* and Glib, and other stuff.  Is there any online
  documentation that sorts all this stuff out?  What are the compliments
  in the Linux/X11 world to MFC/IOCL in the Win32 world?  What about
  resource editors and stuff like that???
 
 I am a KDE user and enthusiast, so my biases are pretty obvious. I also
 really 
 hate C as a language :-(

  Ok, I guess someone needs to recommend the 'other' stuff to him.  I'm
going to leave out the rest of your message in an attempt not to make this
an argument between us, though. ;)

  To the first writer:

  It looks like you're just starting X programming.  The first thing you
should realize (if you don't already) is what the library situation in
X is.  Basically, there's a low-level interface to the X server called Xlib,
but almost no-one uses it because it's hard to get anything done.  To provide
a more convenient programing environment, 'widget sets' are wrapped around
the X libraries; these widget sets are what actually draw the buttons, menus,
and so on that you see on the screen.  There have been a number of widget sets
in the past--Athena, Motif, etc, but currently the two most popular (and
probably the two best) are Qt and GTK+.  Qt was developed by TrollTech and
has historically had some licensing issues (which may be resolved, but I don't
want to go there.  If you're new to X you are also mercifully unaware of the
Widget Set Holy Wars...), while GTK+ was developed for the GIMP (GTK+ stands
for GIMP ToolKit)  Take anything I say about Qt with a grain of salt, simply
because I don't program for it and so I'm not up on the latest news.  In fact,
for that reason I'm going to avoid talking about it at all.

  GTK+ is an object-oriented toolkit implemented in C.  However, you can write
programs for it in C++, Ada, Perl, Scheme, and Python (go to
http://www.gtk.org/language-bindings.html for a more complete list), to name
a few.  GTK+ is based on GDK (which also has language bindings, at least to
C++), the General Drawing Kit, and Glib, the General (?) Library.  GDK is
a wrapper library around Xlib which abstracts the windowing system, while
Glib provides a bunch of general utility functions--either sane replacements
for broken native functions (eg g_malloc, g_fprints) or functions that
implement commonly useful data structures (hash tables for example).  All
the libraries and dependencies are licensed under the LGPL.

  As I mentioned, GTK+ is object-oriented but done in C.  A lot of people
think this is stupid.  I suggest that you at least try it out, and
give GTK-- (the C++ bindings) a spin if you like C++ work.  You can do
pretty much everything that you'd want to do in C++ using GTK--, including
deriving new widgets and so on.  The only real problem is that it's difficult
for people using C to use the new widgets you create.  That might not be an
issue for you, however, or you could find a way to wrap C++ widgets in C
and be a hero. :-)  I personally find it to be really fun to program in, in C
or in C++.  Some sample code:

--- C++ (from an attempt at a LILO config program I was writing)

lilo_image_win::lilo_image_win():
  Gtk_Window(GTK_WINDOW_TOPLEVEL),
  basic_label(Basic options)

{
  should_delete=false;
  add(pages);
  pages.append_page(basic_options,basic_label);
  basic_options.show();
  pages.show();
}

  This widget inherited from the Gtk_Window object; you can see the call to the
ancestor contructor there.  basic_label is a label object that was labelling
a text entry if I remember correctly.  pages is a Gtk_Notebook object.
basic_options is the widget which will be displayed in the page for Basic
Options; there's no Advanced Options page because I didn't have time to finish
the project. :-)

-- C (from Freeciv's GTK+ client, not stock code..locally modified)

dialog = gtk_dialog_new();
gtk_signal_connect( GTK_OBJECT(dialog),delete_event,
GTK_SIGNAL_FUNC(connect_deleted_callback),NULL );

notebook=gtk_notebook_new();

gtk_box_pack_start( GTK_BOX( GTK_DIALOG( dialog )-vbox ), notebook, TRUE, 
TRUE, 10 );

frame = gtk_frame_new( Freeciv Server Selection );
label = gtk_label_new( Connect );

gtk_notebook_append_page( GTK_NOTEBOOK( notebook ), frame, label );


  This does something similar but in C.  gtk_dialog_new() is the constructor
for a 'dialog' object.  The dialog object is a convenience that GTK+ provides;
it's a normal window with some layout objects already contained in it that are
useful for creating dialogs (stuff on top, buttons along the bottom).  The
signal_connect call adds a callback, a 

Re: GUI stuff

1999-02-16 Thread Kirk Hogenson
David Webster wrote:
 
 I am wanting to start some GUI development but I am having a hard time
 figuring out just what the GUI development is?  I see that the GTK
 libaraires are the base C++ GUI class libraries, but I also see stuff
 like Gnome and qt* and Glib, and other stuff.

Gnome is based on the GTK toolkit.   Glib is a part of GTK, and
isn't related to GUI stuff, its got linked-lists and whatnot.
GTK is a GUI toolkit for C.

Qt is a C++ library.  (No wrappers that I know of -- it is much
harder to wrap an OO-library, unless you're wrapping in another
OO language...)

Gnome is not a GUI library, its a whole integrated desktop system.
So is KDE.  KDE uses Qt is its GUI toolkit.

 Is there any online
 documentation that sorts all this stuff out?  

You can try http://www.theoffice.net/guitool, which lists a dizzying
array of GUI tools.  

You will also find a huge repository of useful programming info (not 
just GUI) at http://www.iro.umontreal.ca/~ratib/code/.  (It isn't 
organized by tool type, so you'll have to click on the language you 
like, and look for GUI tools there.)

 What are the compliments
 in the Linux/X11 world to MFC/IOCL in the Win32 world?  What about
 resource editors and stuff like that???

There is no standard GUI toolkit for Linux.  Motif used to be
standard (for UNIX in general), but that was only because it was the 
only one around.  Since it is a commercial product and began to stale, 
eventually alternatives began to emerge.  Now, you have many to choose 
from.

Here is a short list, to get you started.

- GTK (C)
  - Best choice if you want to program in C.  Basis of Gnome.
Wrappers exist for many other languages, for example GTK-- is
a C++ wrapper.
  - http://www.gtk.org

- wxWindows (C++)
  - This one is my favorite.  Quite mature.
  - It's a cross-platform tool, and the one for Linux is based
on top of GTK.
  - The main page is at
  http://web.ukonline.co.uk/julian.smart/wxwin
  - The GTK version's page is at 
  http://wesley.informatik.uni-freiburg.de/~wxxt/

- V (C++)
  - Simpler than wxWindows, easier to learn.  I've only experimented 
with it briefly, but it seems pretty nice if your needs are modest.
  - http://objectcentral.com

- Qt (C++)
  - Troll Tech's infamous library.  Basis for the KDE project.
I personally have never used it, but I gather it is very nice
(though C++ purists dislike some of their design choices!)
  - http://www.troll.no

- There is a MFC port to Linux, I believe, though I don't know anything
  about and I do not want to know.

- Java's AWT (Java)
  - The AWT is getting better.  Write once, debug everywhere!

- YACL (C++)
  - I've heard good things about this, but never used it or even
read much about it.
  - http://www.cs.sc.edu/~sridhar/yacl/

That's only a start, though I think I got most of the popular
GUI toolkits for Linux.  

I'd recommend wxWindows if you will be programming in C++, or maybe V.  
Both exist as Debian packages, though a new major version of wxWindows 
(2.0) will soon be released.  I expect it will be debianized soon after.  
(If not, maybe I will do it!)  Qt is also .deb'ed, and is coincidentally 
also approaching 2.0.

I hope this clears things up rather than making it more confusing...

Kirk


Re: GUI stuff

1999-02-16 Thread Havoc Pennington

On Tue, 16 Feb 1999, David Webster wrote:
 I am wanting to start some GUI development but I am having a hard time
 figuring out just what the GUI development is?  I see that the GTK
 libaraires are the base C++ GUI class libraries, but I also see stuff
 like Gnome and qt* and Glib, and other stuff.  Is there any online
 documentation that sorts all this stuff out?  What are the compliments
 in the Linux/X11 world to MFC/IOCL in the Win32 world?  What about
 resource editors and stuff like that???
 

Here is my take on things, somewhat different from other answers perhaps. 
I am a Gnome developer and wrote some of the Gnome library stuff (just so
you know my biases). 

Gtk+ is an object-oriented library written in C. It is a widget set,
which means it lets you create windows, text entries, scroll bars, etc.
See http://www.gtk.org. It's written in C, but works great with C++; I use
it all the time. If you prefer there are several C++ wrappers though,
which let you subclass widgets, etc. There are also wrappers in a dozen
other languages.

glib is a C utility library which deals with some code portability
concerns and fleshes out the C standard library with some data structures
and the like. Gtk uses it, as do many Gtk programs.

Gnome has two faces. From the developer's point of view it is an
application development framework. It adds a lot of useful widgets to Gtk,
adds some convenience functions, adds some things like configuration file
loading/saving, adds CORBA (analagous to DCOM), adds image file loading,
etc. This is all in the 'gnome-libs' package. 

The other face of Gnome is a desktop environment and set of applications
built using the developer's framework. However, if you use the framework
your users are not forced to use Gnome; gnome-apt, for example, runs just
fine without any of the desktop stuff installed. (The desktop environment
includes a file manager like Windows Explorer, a start-menu type thing,
etc.)

If you are going to write a new GUI application you should use Gnome, IMO.
Here are the reasons:

 - Gnome is nicer than the alternatives, unless you have special needs 
   (like a cross-platform toolkit).

 - Gnome is 100% free; this means you can write applications with it 
   using the license of your choice, and paying no license fee.

 - Partially as a consequence of the above, Gnome is likely to be the 
   future standard environment, and well-supported

 - Debian and Red Hat are both supporting Gnome as the standard 
   desktop (to the extent that anything can be standard in the 
   free software world; really this just means default).

 - This means Debian and Red Hat users will have Gnome installed 
   already, so they'll be able to compile your app easily.

 - Gnome is supported by 250+ developers; most other kits are supported
   by a few people. Stuff gets fixed fast, and there is a lot of stuff.


Some people advocate using only Gtk and not Gnome. If your app is at all
substantial, this is a poor idea IMO (and I have written several apps). 
It is short-term attractive because you don't have to learn and compile
the Gnome libraries. But once Gnome hits 1.0, expected this month,
this advantage disappears. Gnome offers a standard look-and-feel and a
*lot* of programming conveniences. It's a significant enhancement to plain
Gtk.

Again, unless you have special needs such as cross-platform development,
it's probably a poor idea to use a toolkit other than Gtk. Gtk appears to
be an emerging standard (finally), and you'll end up with an ugly legacy
dependency using other kits. And if you're using Gtk, it only makes sense
to use Gnome too.

To be fair, Qt and KDE are likely to continue to be popular for a good
long while and they may even be the most popular at the moment (hard to
say). Qt is cross-platform and commercially supported. However, you will
have to pay to use Qt for a proprietary application. And it is my guess
(only a guess) that Gtk will be longer-lasting and more popular on a
2-to-5-year timescale. But you should make your own judgment on that after
you do some research. 

Havoc