After yesterday's thread I understand that methods bound to a wxPython
widget must be in the same file as the class where the widget is defined and
declared. Now I need guidance on how to provide the same functionality
that's defined in two different source files. I'll explain.
My modeling application's UI uses notebook pages, with each page in a
separate *.py file. There's also the main frame's file.
When the application is invoked, it's necessary to create a new model
(held in a SQLite3 database) or open an existing model. And, of course,
models can be saved and closed, too. These functions are available in three
ways:
1) From the File menu (in the main frame .py file).
2) By typing the file name in the text control widget (in the notebook
page's .py file).
3) By clicking on the "New,", "Open," or "Save" buttons (also in the
notebook page's .py file).
I'd like to have a single method/function to process each type of action,
regardless of which route is chosen by the user. That way, a change (or
error correction) is made in one place and I don't have database creation
code in multiple modules.
Is this an ideal case for use of the model-view-controller paradigm? If
so, I better re-read that chapter in wPIA and re-organize all these modules
before writing more methods.
Suggestions, please,
Rich
···
--
Richard B. Shepard, Ph.D. | The Environmental Permitting
Applied Ecosystem Services, Inc.(TM) | Accelerator
<http://www.appl-ecosys.com> Voice: 503-667-4517 Fax: 503-667-8863