I've an app based on a frame splitted by an horizontal splitter. The bottom splitted window holds a TextCrtl acting as a LOG for my app, the upper window holds several changing Panels, one at time (something like in the wxPython-demo)
Every panel have children, and those children have children too !!!
I need from every child dumping text to the LOG, so the children need a reference for the Log TextCtrl.
I know that exists the oneWindow.FindWindowById(id) that can find a child of 'oneWindow' by ID, but what i need is that
children can find a window of their parents.
I tried to pass to the children the parent reference on __init__ method but the result it's that to access the log i need to do:
It looked to me like you are trying to reimplement the logging system…
The main advantage of my suggestion is the fact that you can add logging to a file with only one line so you will have the log events in the text ctrl and in the file (if that helps in any way) plus… you have all this extra information like time, date, location… that you don’t have to embed yourself in the logging event.
Take a deeper look at the logging API… I guarantee that you will not regret the time invested in it
Peter.
···
On 6/21/06, Felix < felixonta@teleline.es> wrote:
On Wed, 21 Jun 2006 16:43:05 +0300 > “Peter Damoc” < > pdamoc@gmail.com> wrote:
You are right, it is awful. My advice is to use the logging API of Python
and just implement a handler that would take care of the logging.
Here is a sample implementation of what you want:
Hmm… that not what i’m looking for, but i didn’t know about a loggin API, i have
to study it.
Thanks Peter !