title: How can I bind buttons and dialog boxes using tkinter?
body: <p>I'm trying to create a Python GUI with tkinter. Can anyone please advise how I can do the following:</p>
  
  <ol>
  <li>Place the Open button on the top right hand side of my screen</li>
  <li>How can I combine my "Open" button with opening a dialog box where a user can choose which file to open?</li>
  <li>Place the Label under the Open button - all I can do is place them at the top of the root or right of the root</li>
  <li>Do I need to use a canvas as well as a frame..?</li>
  <li>How to send/display mouseclicks (x,y co-ordinates) to the label instead of my console?</li>
  </ol>
  
  <p>My code is as follows: </p>
  
  <pre><code>from tkinter import *
  
  def clicks(event):                          
      print(event.x, event.y)                 
      xy_coord = "x=%d y=%d" % (event.x, event.y)
      return xy_coord
  
  myroot = Tk()                               
  
  label = Label(myroot, text="Co-ord: ", fg="black")  
  label.pack(side=TOP)                        
  
  myFilename = filedialog.askopenfilename(filetypes = ( ("how code files", "*.hc"), ("All Files", "*.*") ) ) 
  print(myFilename)
  
  button = Button(myroot, text="Open file: ", fg="Blue") 
  button.bind("&lt;Button&gt;", click)
  button.pack(side=RIGHT, padx=5, pady=5)     
  
  frame = Frame(myroot, bg="Grey", width=300, height=300) 
  frame.bind("&lt;Button&gt;", clicks)              
  frame.pack(expand=YES, fill=BOTH)           
  
  myroot.mainloop()                           
  </code></pre>