title: tkinter - remove border / padding from gif button / label
body: <p>I know there is a lot of info related to this question, but I cannot get any of it to work with my specific situation.</p>
  
  <p>I'm trying to create a tkinter button menu out of gifs and I want these gifs to be flush up against one another, no border, no spacing. I've been able to achieve this with a regular button, but not with a button with an image file. I've attempted this with labels and there is no "border", but I still cant get rid of the padding, even after setting the relevant attributes to "0".</p>
  
  <p>I'm aware of both the "bd" and the "highlightthickness" attributes and I'm pretty sure that the highlightthickness attribute is specific to the canvas widget, but I could be wrong? Either way, i've put it just about anywhere I can think and I still have this annoying border.</p>
  
  <p>Can anyone point me in the right direction here? I'm a newbie to python and tkinter, but relatively comfortable with coding. This seems almost as straightforward as html tables, etc, but ive spent a couple nights scouring the internet and I can't find any answers, let alone any example of an image based button menu without spacing issues.</p>
  
  <p>Apologies again for the newbie-ness of this dilemma. Any guidance will be greatly appreciated. Thanks!</p>
  
  <hr>
  
  <p>code example using "Label" widget:</p>
  
  <pre><code>from Tkinter import *
  
  root = Tk()
  root.wm_title("Window Title")
  root.config(background = "#FFFFFF")
  
  leftFrame = Frame(root, width=600, height = 800, bd=0, highlightthickness=0)
  leftFrame.grid(row=0, column=0, padx=0, pady=0)
  
  try:
      imageEx = PhotoImage(file = 'nav1.gif')
      imageEx2 = PhotoImage(file = 'nav2.gif')
  
      Label(leftFrame, image=imageEx).grid(row=1, column=0, padx=0, pady=0)
      Label(leftFrame, image=imageEx2).grid(row=2, column=0, padx=0, pady=0)
  
  except:
      print("Image not found")
  
  root.mainloop()
  </code></pre>
  
  <hr>
  
  <p>code example using "Button" widget:</p>
  
  <pre><code>import Tkinter as tk
  
  button_flag = True
  
  def click():
      global button_flag
      if button_flag:
          button1.config(bg="white")
          button_flag = False
      else:
          button1.config(bg="green")
          button_flag = True
  
  root = tk.Tk()
  
  frame1 = tk.Frame(root)
  frame1.pack(side=tk.TOP, fill=tk.X)
  photo1 = tk.PhotoImage(file="nav1.gif")
  button1 = tk.Button(frame1, compound=tk.TOP, width=320, height=55, image=photo1,
      text="", bg='green', command=click, bd=0, highlightthickness=0)
  button1.pack(side=tk.LEFT, padx=0, pady=0)
  button1.image = photo1
  
  
  frame2 = tk.Frame(root)
  frame2.pack(side=tk.TOP, fill=tk.X)
  photo2 = tk.PhotoImage(file="nav2.gif")
  button2 = tk.Button(frame2, compound=tk.TOP, width=320, height=55, image=photo2,
      text="", bg='green', command=click, bd=0, highlightthickness=0)
  button2.pack(side=tk.LEFT, padx=0, pady=0)
  button2.image = photo2
  
  
  root.mainloop()
  </code></pre>