Bruno Desthuilliers wrote:
Do you mean the code effectively doing these operations is in the gui ?
If yes, it would be better to factor it out IMHO.
The GUI has to be able to acces the data object, otherwise how does the
user affect any changes to the application data? If I modify a value in
[EMAIL PROTECTED] wrote:
Bruno Desthuilliers wrote:
Do you mean the code effectively doing these operations is in the gui ?
If yes, it would be better to factor it out IMHO.
The GUI has to be able to acces the data object, otherwise how does the
user affect any changes to the application
Bruno Desthuilliers wrote:
Separating operations on data (model/controler) from GUI code (view).
The controler(s) have a reference on the model. The views have a
reference on the controler(s), and call on the controller to get data to
display or act on data.
So I instantiate a Model object
[EMAIL PROTECTED] wrote:
So I instantiate a Model object that handles all IO to the database.
Next I instantiate a Controller object, passing it a reference to the
Data/IO model object. Next I instantiate the display panel objects for
the GUI, passing them references to the Controller object.
[EMAIL PROTECTED] wrote:
Bruno Desthuilliers wrote:
Separating operations on data (model/controler) from GUI code (view).
The controler(s) have a reference on the model. The views have a
reference on the controler(s), and call on the controller to get data to
display or act on data.
So I
Lets say that I have an application consisting of 3 files. A main.py
file, gui.py and a data.py which handles persistent data storage.
Suppose data.py defines a class 'MyDB' which reads in data from a
database, and main.py creates an instance of this object. How does code
in gui.py access this
[EMAIL PROTECTED] wrote:
Lets say that I have an application consisting of 3 files. A main.py
file, gui.py and a data.py which handles persistent data storage.
Suppose data.py defines a class 'MyDB' which reads in data from a
database, and main.py creates an instance of this object. How does
[EMAIL PROTECTED] wrote:
Lets say that I have an application consisting of 3 files. A main.py
file, gui.py and a data.py which handles persistent data storage.
Suppose data.py defines a class 'MyDB' which reads in data from a
database, and main.py creates an instance of this object. How does
Jeremy Jones wrote:
What does main.py do? Are you creating an instance of the gui thingy?
If so, you could just pass DataObject into your gui thingy either into
the constructor or to a setter once you create an instance of it.
It's a wxPython app. I created the GUI initialy using wxGlade
[EMAIL PROTECTED] wrote:
snip
Doh! How simple. Why didn't I think of that? I'm too used to procedural
scripts where you'd just put everything in a global data structure. I
know this is bad, but it's hard to get out of that mentality.
Sounds like you got it. Just pass it on down as needed.
[EMAIL PROTECTED] wrote:
Jeremy Jones wrote:
What does main.py do? Are you creating an instance of the gui thingy?
If so, you could just pass DataObject into your gui thingy either into
the constructor or to a setter once you create an instance of it.
It's a wxPython app. I created the
11 matches
Mail list logo