From: Rowland S. <ro...@we...> - 2001-10-22 19:09:01
|
Kevin Altis wrote: >>From: Patrick K. O'Brien >> >>I was trying to find a reason to get more involved in PythonCard >>by finding >>a project that overlapped my current interests. Namely, using ZODB as the >>persistent storage for simple database applications that will have a >>wxPython interface (as well as a web interface and possibly a Zope >>interface). I also thought picking a sample app that embraced the need for >>multiple windows (which a few people mentioned as a high priority) would >>help focus our efforts. >> > > We do need multiple windows. In fact, in order to make reasonable progress > on an environment we need to be able to create the environment in PythonCard > itself, since it takes too much time and effort to do every piece using raw > wxPython. If we can redo the Message Watcher, Property Editor (a better one > this time) as PythonCard windows they will be much easier to maintain and > enhance. My first window was the FindDialog and once we get past these > future direction messages, I'll get back to that. We can then start adding > other dialogs and windows we would need for an environment, redo the > resourceEditor, etc. I have multiple windows working in the prototype of the design I posted to the list the other day. I'm copying pasting code from PythonCardPrototype in to my prototype and have a sample app that: Loads from a Resource file. Has multiple windows, as specified in the resource file. Can handle MouseClickEvent generated from Button All Components ( Button ) in this case, can have their own Script object that handles any Events for the Component. The Script/Scriptable model is very flexible and will allow us to build a user scripting environment ala Handlers and the last PythonCardPrototype. Rewriting the MessageWatcher, etc. using strictly PythonCard should be pretty straightforward with Components and Scripts. I'm making lot's of progress today and will post what I have this evening. > >>Based on your feedback it sounds to me like there is no overlap. Sigh. >> > > I wouldn't say that. Why can't that just be a sample? You'll probably have > less issues with a moving class spec which is what is going to cause trouble > with ZODB, which has no generic external tools for manipulating the > database. This is more or less the direction I wanted to go with the > textIndexer and addresses samples, both or which have the beginnings of a > more generic storage model. > > So, your idea is a good one, why not get started? As pieces are solidified, > we can transition them to the general framework. If we can define a set of interfaces that provide an abstraction layer to discovering changes and then storing those changes, anyone could work on implementations for Zope, XML files, etc. on their own and then we could roll them into the code base. Here are my ideas for a storage abstraction: class ChangeEvent( Event ) : def __init__( self, changeable ) self.changeable = changeable class ChangeEventListener : def changed( changeEvent ) : raise 'abstract-method-error' class Changeable : def addListener( changeListener ) ... def fireChangeEvent( changeable ) # call changed( ChangeEvent( changeable ) ) on # all listeners Components can be Changable, and the persistence subsystem can register as a listener to a Document object class Component( Changeable ) : ... class Document( Changeable ) : ... class DocumentStorage( ChangeEventListener ) : def changed( changeEvent ) ... Documents listen for ChangedEvents generated by Components, DocumentStorage objects listen for ChangeEvents generated by Documents. Something like DocumentStorage would be the abstraction layer between PythonCard and Zope, mySql, XML files, etc. When we get to the HyperCard model, we chould have a StackStorage class, or something to that effect. > ka > > > _______________________________________________ > Pythoncard-users mailing list > Pyt...@li... > https://lists.sourceforge.net/lists/listinfo/pythoncard-users > > > -- Talk to ya, Rowland "The whole problem with the world is that fools and fanatics are always so certain of themselves, and wiser people so full of doubts." -- Bertrand Russell, quoted in the book A Word a Day |