On Fri, Oct 31, 2008 at 8:29 AM, Edward K. Ream <[EMAIL PROTECTED]> wrote: > > It's time to create a proper tree of classes/subclasses for text > widgets in the qt plugin. This will be the framework that contains > the forthcoming wrapper for the QLineEdit widgets that QTreeWidget > uses to edit headlines. This will also be the proper way to fix the > indexing bug described at: https://bugs.launchpad.net/leo-editor/+bug/286493 > > I would like to add the capabilities of an interface mechanism.
The Zope3 Component Architecture is built on Interfaces and their implementation, and Adapters. Z3 interfaces are getting used more and more widely, they are not just for the Web anymore. I would suggest understanding them before risking reinvention. > Something like this was discussed on the IPython list recently. The > following describes my present thinking. Feel free to ignore the > rest, it's just thinking out loud... > > My design goals: > > 1. Avoid mixin classes. I don't want multiple inheritance if it can > be avoided. So the "base" text-edit class in the qt plugin will likely > be a subclass of leoInterface. > > 2. The leoInterface class will use the same straightforward approach > used in leoFrame.py, namely lists of names of members that must be > defined "somewhere", "in the base class" or "in subclasses". > > 3. The leoInterface will have a method that tests the relationships > described in point 2. This test will probably be done in the > leoInterface.ctor. Unless I am mistaken, this will work because > "self" will be the subclass, so the subclasses "must be defined" lists > will be available. > > 4. Eventually, the corresponding unit tests in unitTest.leo can be > eliminated, because in effect they will be run every time Leo starts > up. > > If all goes well the leoInterface class will migrate to the core. > > Edward > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "leo-editor" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/leo-editor?hl=en -~----------~----~----~----~------~----~------~--~---
