There’s a combobox event in my code:
self.combobox1.Bind(wx.EVT_COMBOBOX, self.onActionCombobox1)
It executes the function
def onActionCombobox1(self, event):
Is there a way to execute this function automatically everytime when I start my program?
I tried it like this:
self.onActionCombobox1(event)
but it says Undefined variable: event
if you do not make use of the event variable you want to do:
This, set in the
__init__method of your class, will execute the method at class instantiation (not necessarily equivalent to program startup as in wxPython you can have windows/widgets that can be created dynamically at run time. You could call the method from the class before instantiating it but then method actions have not to be related with any widget state or behavior as they do not exist yet. Anyway, in that case maybe the method should be written better as an independent function).