Re: Data access from multiple code modules
- From: simon.hibbs@xxxxxxxxx
- Date: 12 Jul 2006 07:59:18 -0700
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 which
gave me a small myapp.py script, a file containing the main application
frame (containing a listbook controll) and several files containing
panel classes. Each panel class contains controlls for performing
various operations on the data set (adding records, deleting them,
running various transformations). I can't say I understand how it all
works at a deep level, although I've been hacking it about quite
successfuly so far.
Presumably if I pass DataObject through to the Frame object, and from
there through to the Panel objects then presumably this will solve the
probelm? I guess it would be passed by reference so all the panels
would be working on the same data object?
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.
Many thanks,
Simon Hibbs
P.S. Regular reader of your blog on Oreillynet.
.
- Follow-Ups:
- Re: Data access from multiple code modules
- From: Bruno Desthuilliers
- Re: Data access from multiple code modules
- From: Jeremy Jones
- Re: Data access from multiple code modules
- References:
- Data access from multiple code modules
- From: simon . hibbs
- Re: Data access from multiple code modules
- From: Jeremy Jones
- Data access from multiple code modules
- Prev by Date: Re: Persistant dictionary with lockable elements
- Next by Date: Re: Editing File
- Previous by thread: Re: Data access from multiple code modules
- Next by thread: Re: Data access from multiple code modules
- Index(es):