[isc.mail.xpert] XView Toolkit

fischer@iesd.auc.dk (Lars P. Fischer) (06/21/91)

>>>>> On 18 Jun 91 07:34:06 GMT, mago@delphi.it (Giovanni Beani) said:

Giovanni> 1) "On what platforms (SunOS, SCO, VMS, etc. etc.) the XView toolkit
Giovanni> is present at moment?"

Sun-3/SunOS, SPARC/SunOS is available from MIT.
IBM/AIX, DEC/Ultrix, HP/HPUX is available from Unipress (see add in
UnixWorld, June '91, p.97).
Quaterdeck claims to have a PC/DESQview version "real soon now".
I've heard of a Mac/AUX port, but I can't remember by whom.
Can't remember hearing of a SCO port, offhand.

Giovanni> 2) "What about differences (for a programmer view) between
Giovanni> Motif and XView?"

OSF/MOTIF is based on the X Toolkit Intrinsics, while XView uses a
completely different API. The XView API is modeled on the SunView API,
making the transition easier for Sun programmers.

In my view, the XView API is nicer to work with. It's much simpler for
beginners to learn, and you quickly get up to speed. It has some nice
layout facilities for panels, and in general provides some nice
abstractions. It's callback method is both simple and powerful.

The XView API is mature, having existed in various forms on Sun
platforms for years. It's not exactly elegant, but in daily use it's
a very practical tool. It shows it's age in places. The models is
kind-of object oriented, and you *can* create subclasses, but to do so
you have to take quite a leap. You can't really blame XView here --
doing OO without language support isn't my kind of fun, an Intrinsic
based toolkits are no better in this respect. (A good C++ toolkit
or a C++-encapsulation of XView would help here).

I've done some major (commercial) projects with XView, and I have
taught it with quite a bit of success. I like it. 

Oh, and Dan Hellers book on XView (vol. 7 in the ORA series) is really
very good for learning how to use XView. Also, the GUIDE user
interface editor (available for Sun's for $200) is really handy for
prototyping things and for learning how to put things together.
Looking through the code generated by GUIDE is often a very good way
to pick up the right approach for handling a job.

/Lars
--
Lars Fischer,  fischer@iesd.auc.dk   | It takes an uncommon mind to think of
CS Dept., Univ. of Aalborg, DENMARK. | these things.  -- Calvin

fischer@iesd.auc.dk (Lars P. Fischer) (06/21/91)

>>>>> On 18 Jun 91 23:13:15 GMT, klee@wsl.dec.com (Ken Lee) said:

>>>>> mago@delphi.it (Giovanni Beani) writes:

Giovanni> 2) "What about differences (for a programmer view) between
Giovanni> Motif and XView?"

Ken> There are lots of little differences.  The most important one is that
Ken> Motif uses the standard X Toolkit intrinsics library and XView uses a
Ken> proprietary intrinsics library.

"proprietary" is a bit misleading here. The XView API is *different*
from the one used by Intrinsics based toolkits, but it's not
proprietary.You can implement this API in any way you wish, for any
platform or OS. XView itself is freely available from MIT. Sadly, the
free version really works only on Suns, but there's nothing to prevent
you from porting it. Even the fonts used are freely available.

Ken> The X Toolkit intrinsics are documented by MIT and in many other
Ken> books and tutorials.  The XView intrinsics are, as far as I know,
Ken> documented in only one O'Reilly book.

True, but then, how many books do you need? The XView API is really
very simple and easy to learn, and the O'Reilly volume does a good
job.

The Intrinsics based toolkits have one thing in their favor, though.
Converting from one Intrinsics based toolkits to another is
(theoretically) simple, while converting from XView to, say, OSF/MOTIF
is a bigger job. If you plan to much conversion of this kind, take a
look at OLIT for OPEN LOOK. Be warned, though, that you will have to
think of conversions in advance, i.e. select layouts and features
available in both OSF/MOTIF and OPEN LOOK, or else you'll wind up
rewriting large parts of the UI anyhow.

/Lars
--
Lars Fischer,  fischer@iesd.auc.dk   | It takes an uncommon mind to think of
CS Dept., Univ. of Aalborg, DENMARK. | these things.  -- Calvin

mwette@csi.jpl.nasa.gov (Matt Wette) (06/21/91)

While we're on XView, there's one thing I haven't been able to figure
out yet.  Is there a way to control resizing of widgets when a window
is resized?  (like the way you can using XtSetArg(XtNleft,XtChainLeft)
in Xaw)

Matt
-- 
 _________________________________________________________________
 Matthew R. Wette           | Jet Propulsion Laboratory, 198-326
 mwette@csi.jpl.nasa.gov    | 4800 Oak Grove Dr, Pasadena,CA 91109
 -----------------------------------------------------------------

jordan@tcs.com (Jordan Hayes) (06/25/91)

Leif Andrew Rump <andrew@ambra.dk> writes:

	How does a simple Motif program look like?

Nearly the same as your XView example.  So what?

/jordan

#include <Xm/Xm.h>
#include <Xm/Frame.h>
#include <Xm/Label.h>

static String	fallbacks[] = {
    "*width:			200",
    "*height:			100",
    "*label.labelString:	Hello World!",
    NULL
};

main(argc, argv)
	int	argc;
	char	**argv;
{
	Widget		top, frame;
	XtAppContext	app;

	top = XtAppInitialize(&app, "Hello", (XrmOptionDescList)NULL,
	    (Cardinal)0, (Cardinal *)&argc, argv, fallbacks,
	    (ArgList *)NULL, (Cardinal)0);
	frame = XtCreateManagedWidget("frame", xmFrameWidgetClass, top,
	    (ArgList)NULL, 0);
	(void)XtCreateManagedWidget("label", xmLabelWidgetClass, frame,
	    (ArgList)NULL, 0);
	XtRealizeWidget(top);
	XtAppMainLoop(app);
}