[9366] in The GTK GIMP ToolKit mailing list archive

home help back first fref pref prev next nref lref last post

[gtk-list] Re: Using C++ with Gtk

daemon@ATHENA.MIT.EDU (Dave Reed)
Fri Oct 16 17:20:34 1998

Date: Fri, 16 Oct 1998 17:14:20 -0400
From: Dave Reed <dreed@capital.edu>
To: gtk-list@redhat.com
Cc: smolitor@insight-tech.com
In-Reply-To: <000001bdf93c$11223390$1538040a@w9zzgwa.genam.com>
	(smolitor@insight-tech.com)
Resent-From: gtk-list@redhat.com
Reply-To: gtk-list@redhat.com

 
> Is anyone out there coding in Gtk (not Gtk--), using C++?  I'm thinking of
> the approach described in the book "Object Oriented Programming with C++ and
> Motif," by Young.  Instead of creating a complete C++ wrapper around Motif,
> Young describes how to create C++ components that encapsulate large chunks
> of Motif C code and widgets.  For example, one could create a tic-tac-toe
> board component (C++ class) that would encapsulate a bunch of Motif widgets
> (usually as a single-rooted widget tree).
> 
> I'm not describing this very well, but if you've read the book you'll know
> what I mean.  So is anyone doing something similar with C++ and Gtk, and do
> they have any pointers?  Again, I'm aware of Gtk--, but that's not what I'm
> asking about
> 
> Steve Molitor
> smolitor@insight-tech.com

I've seen that other people have already replied about this, but just
wanted to let you know that Young's ideas from the book were used to
create SGI's ViewKit library (I'm pretty certain Young wrote it for SGI
while working for them)- it's very similar to the book, but I think it
includes a few improvements.  If you have access to an SGI machine,
you might want to check it out for some ideas.  I used ViewKit while
in graduate school and found it very nice - a good tradeoff between
low-level control (which you could do if you wanted to by directly
manipulating the Motif widgets) and a higher level, VERY reusable
interface.

At one point, I started a ViewKit-like library on top of gtk+, but
unfortunately, I didn't (and still don't) have time to do much with
it.  It has the following classes:

GkApp (application class)
GkComponent (the base component class)
GkWindow (generic window)
GkWindowMenu (generic window w/ menu support)
GkMesaGL (encapsulation of a Mesa rendering window w/ support for the
various callbacks)

and one or two others.

If you'd like to see it, I'll be happy to make it available, but I did
so little work that you might as well just start over exactly how you
want it to be.

Dave
dreed@capital.edu

-- 
To unsubscribe: mail -s unsubscribe gtk-list-request@redhat.com < /dev/null


home help back first fref pref prev next nref lref last post