Python GUI: document/view versus window

James C. Ahlstrom (jim@interet.com)
14 Mar 1995 16:07:47 -0500

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