views:

24

answers:

1

I'm working on a GUI program in which I already bind a start button with one event, and when I click the start button, the event runs as I like. My question is, if I want my program to start the event immediately after the GUI program starts, which means the start button is immediately being "clicked" once the program starts, how do I do it?

+1  A: 

In the main frame constructor set a one-shot timer with interval 0 that fires the event.

Eli Bendersky
Would you please be more specific? I just don't know where to put the code and how to add the timer.
Shane
@Shane: I'm not sure how I can be more specific. Here's some docs on wxPython timers: http://wiki.wxpython.org/Timer, Google for more. Do you have a main frame for your application? Does it have a constructor?
Eli Bendersky
Now I know how to make it work. Thanks
Shane