How to make GUI draw - before time consuming call?

Simply initialise text_ctrl_Output to something like "Getting Data
Please Wait", in FillText get your data before clearing the text control
and at the end of __init__ use wx.CallAfter(FillText) to populate your
default list after the GUI is drawn. You might also like to consider
keeping the data, i.e. assigning it to self.DataList or some such then
you will not need to reread all the files on each display filter change.

Gadget/Steve

···

On 28/12/2011 7:14 PM, MartinHvidberg wrote:

I�m fooling around with wxPython, 1�st time � and have a question�

I�ve used Glade to set up (draw) a GUI as I want it. I�m now in a
phase of adding functionality.
Basically the program should read the win-log files and quickly list
when I have logged in and out the last weeks (months), so I can get
easily around time registration at work. All the log file reading is
handled by a sub-program �nTidCore�, that is not part of this
question.

My problem right now is essentially a question of timing in drawing
the GUI. The GUI is good looking as it is, but I need to call a sub-
routine �FillText� to populate various fields. This subroutine has to
read through all the logs, and do potentially take like 10 seconds. I
would like the GUI to get fully drawn to the screen, before calling
the sub routine, so that the user can look at a nice GUI, maybe saying
�Please wait a moment�, while it reads through.

Where, in the code, do I put the call that populates my variables, so
that the GUI will draw first, before this time consuming call?

I include my code, in case it can help you answer my question.

Thanks in advance� Martin