Re: Python GUI: document/view versus window

Jon M. Kutemeier (jkute@mcs.com)
Tue, 14 Mar 95 17:13:23 -0600

the NeXT uses this same basic concept (document/view), where the
main function of a window is to contain one or more views, and the
views are responisible for display data, interacting with the user,
etc. personally, i find this an easy model to work with, and
wouldn't mind seeing python UI things drift in that direction. in
fact, it's possible that a NeXT module could be written that would
use NeXT's Foundation classes in the same manner as the MFC classes,
thus providing another platform for development and portability. In
the future, this could even extend to the OpenStep spec.

-jon
jon@vnp.com

Begin forwarded message:

To: python-list@cwi.nl
Sender: python-list-request@cwi.nl
From: jim@interet.com (James C. Ahlstrom)
X-Newsgroups: comp.lang.python
Subject: Python GUI: document/view versus window
Date: 14 Mar 1995 16:07:47 -0500
X-Organization: Interet Inc., Millburn, NJ USA

The Microsoft GUI C++ class library MFC uses a Document and View model
instead of a Window model. The Document class is responsible for
opening/reading/writing files. The View class is responsible for
displaying a document and interacting with the user. There is also
a Window class which describes the frame surrounding a View, but it
is a second-class citizen, and Visual C++ doesn't even derive a class
from it. MFC wants you to ignore it. (There is also a frame window
around the whole app's collection of windows, but that is irrelevant).

Other class libraries like Tkinter (and Tk) and wxWindows treat the
"Window" as the primary object. So does Win32.

The reason I am bringing this up is that a Python GUI model is going
to have to adopt one approach or the other, and I am leaning toward
the document/view model. The main reason is that Microsoft claims
that it offers a higher level of abstraction which enables MFC code
to run on a Mac. Supposedly they have a product to do that. Since
I want Python GUI code to run on Unix, NT and Mac this is attractive.
But will Unix people feel peculiar writing in doc/views? MFC people
will feel peculiar if they don't have doc/view.

Does anyone out there have an opinion on this (are you there Mark)?
Is there some reason why we should[not] use Views? Does anyone care?
The wrong decision now will be hard to change later. Does doc/view
really offer anything? Comments please.

Jim Ahlstrom $clever