X toolkit programming (Was: [lame subject of] Fooey...)


Subject: X toolkit programming (Was: [lame subject of] Fooey...)
From: Paul J. Lucas (pjl@best.com)
Date: Mon Nov 06 2000 - 11:26:58 MST


        Henceforth, please use more descriptive Subjects; thanks.

On Mon, 6 Nov 2000, Jim Kroger wrote:

> I'm having little luck choosing a windowing environment to run, there are so
> many of them. I just don't have the luxury of getting each one, and doing a
> little programming under each until I figure out the strengths and weakness
> of each.

        You don't *have* to do that at all. You *can* program in raw X
        Windows if you like and bypass everything else.

> 1. if I write a program that will run under, say, GTK+ or wXWindows
> or sawmill or flwm ...

        sawmill and flwm are *window* managers, not GUI toolkits. Once
        doesn't "program" under them. GTK+ is, OTOH, a toolkit.

> that program will only run under that window manager, right?

        Wrong. It would run only if the run-time library for the
        toolkit is there. The window manager is irrelevant.

> So if I want to share my program, only people running the same window manager
> can use it, right?

        Wrong. Again, window managers are *not* toolkits. Repeat.

> 2. if I want to share it with Sun users running Solaris, I will have
> to use either GTK+ (with GNOME) or Motif, since those are the new and
> old Sun-sanctioned environments, right?

        I wasn't under the impression that Solaris had GTK+ bundled, but
        Motif is there.

> 3. I use C++, not C. How do I decide which window managers work best
> for object oriented programming?

        Again, forget about window managers.

> I've read here that Motif is very unfriendly to OO C++.

        Motif is not a window manager: it's an X toolkit. mwm is a
        window manager *using* Motif (mwm = Motif Window Manager).

        Anyway, Motif is in C. It's as (un)friendly as any other C API
        to C++. There aer standard tricks/glue to make Motif more
        usable in C++, however. Briefly, you use 'extern "C"' static
        member functions as Motif callbacks and you squirrel away a
        copy of a C++ object's 'this' pointer in a Motif object's extra
        data field (whose exact name I forget just now).

        - Paul



This archive was generated by hypermail 2a24 : Mon Nov 06 2000 - 11:26:52 MST