wx python timer wont run continuously after dialog

This forum can be used to talk about general design strategies, new ideas and questions in general related to wxWidgets. If you feel your questions doesn't fit anywhere, put it here.
Post Reply
soep
In need of some credit
In need of some credit
Posts: 1
Joined: Tue Aug 25, 2015 5:25 am

wx python timer wont run continuously after dialog

Post by soep »

I'm using Python and wxPython to interact between my user and an USB device. The USB device is somewhat slow in processing commands. Therefor, after sending the command, I'm showing a dialog notifying the user about the command and giving the device enough time to process the command. The code:

Code: Select all

def ActionOnButtonClick( self, event ):
    # Send command to USB device;
    device.Send("command")

    # Notify user + allowing device to process command;
    dlg = wx.MessageDialog(parent=None, message="Info", caption="Info", style=wx.OK)
    dlg.ShowModal()
    dlg.Destroy()

    # Start timer;
    self.RunTimer.Start(500)
When I run the code like this the "RunTimer" will run only once. After some testing I noticed that when I remove the messagedialog, the RunTimer will run continuously without any problems.

I can't figure out what I'm doing wrong. Any thoughts/ideas?

Thank you in advance for your answer!

Best regards,

Peter
Post Reply