title: python tkinter button events
body: <p>I have written the following code to list all directories/files in a given path and then write them to a button. How can I use tkinter's events handler so that whenever any button is double clicked within the widget window it calls a new function.</p>
  
  <pre><code>def display_toplevel(globpath):
      global row, column
      dir=globpath
      dirs = os.listdir(dir)
      for file in dirs:
          Button(master, width=8, height=4, text=file).grid(row=row, column=column, padx=10, sticky=W)
          column = column + 2
          if column == 10:
              row = row + 3
              column = 0
              column = column + 2
              break
  </code></pre>