title: How to use `wx.ProgressDialog` with my own method?
body: <p>How can I use the <code>wx.ProgressDialog</code> to time my method called <code>imgSearch</code>? The <code>imgSearch</code> method finds image files on the user's pc. How can I make the <code>wx.ProgressDialog</code> run while <code>imgSearch</code> is still running and display how long the <code>imgSearch</code> is taking?</p>
  
  <p>Here's my code:</p>
  
  <pre><code>def onFind (self,event)# triggered by a button click
      max = 80
      dlg = wx.ProgressDialog("Progress dialog example","An informative message",parent=self, style = wx.PD_CAN_ABORT| wx.PD_APP_MODAL| wx.PD_ELAPSED_TIME| wx.PD_REMAINING_TIME)
  
      keepGoing = True
      count = 0
      imageExtentions = ['*.jpg', '*.jpeg', '*.png', '*.tif', '*.tiff']
      selectedDir = 'C:\\'
      imgSearch.findImages(imageExtentions, selectedDir)# my method
  
      while keepGoing and count &lt; max:
  
      count += 1
      wx.MilliSleep(250)
  
      if count &gt;= max / 2:
          (keepGoing, skip) = dlg.Update(count, "Half-time!")
      else:
          (keepGoing, skip) = dlg.Update(count)
  
      dlg.Destroy()
  </code></pre>