|
From: Rowland S. <ro...@we...> - 2001-11-29 23:16:17
|
Kevin Altis wrote: > Jeff has made a good point about modularizing the current widget > organization. Right now, all the widgets are defined in widget.py and other > related elements are in spec.py, event.py, wxPython_binding.py. Part of the > reason I went to the trouble of cleaning up the import statements in the > framework was to simplify breaking widget.py up into separate modules, which > I've wanted to do for a long time. Ideally, it would be nice to have one > widget class per module file or to put all related widgets in a file. For > example, TextField, PasswordField, and TextArea are all related text field > classes. > > I don't actually know how to do a sub-package for the widget modules or what > impact this would have on the rest of the framework. Sometimes, there are > references to a widget class such as: > PythonCardPrototype.widget.Button > > Ideally, rather than needing explicit imports, maybe the import statements > could be wrapped in a for loop to import all of the modules in a widget > directory? That would allow you to add additional widget modules without > changing the rest of the framework. I need some help and suggestions from > the Python wizards here. Not sure how to do it, but I vote for this solution. Dynamic loading of the widget library would be sweet. > If we can do a reasonable split of widget.py, then the next step is to > incorporate Jeff's ideas so that the spec and event classes specific to a > given widget are contained in its module. Each widget module could also > contain its own unit tests, which would be very nice. Yep, this sounds good to me. I'd be glad to help on this one. I haven't looked at Jeff's code yet but it sounds like he's on the right track. > These changes would move us much closer to treating widgets like real > components. > > I think for py2exe to process the files correctly, you need real import > statements, you can't rely on the framework doing some magic parsing of each > module. > > I'm still trying to grok Jeff's code, so some or all of the answers to the > questions above may be waiting in his code. > > 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 |