Shane
Shane

Reputation: 4983

How to make a event run immediately after a GUI program starts in wxpython?

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?

Upvotes: 0

Views: 241

Answers (2)

Jeff Hanna
Jeff Hanna

Reputation: 11

In the __init__( ) for your main frame put this:

wx.CallAfter( func_name )

Upvotes: 1

Eli Bendersky
Eli Bendersky

Reputation: 273884

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

Upvotes: 1

Related Questions