[Tutor] Tkinter, Frame and Canvas question.

Hugo González Monteverde hugonz-lists at h-lab.net
Thu Feb 23 18:26:44 CET 2006


Hi all,

I'm running into trouble displaying some Tkinter Canvases, they keep a 
border between themselves and there's no way I can have them display 
without a grey gap between them.

I've narrowed the problem to the following example. I've tried all kind 
of padding and border parameter to the Frame's pack() method and the 
Canvas' pack() method.

Is there something I'm missing or plainly not understanding? I'd like to 
  display canvases one next to the other without some kind of background 
showing throug.

Thanks for taking a look, here's the example:

=======================

import Tkinter
from Tkconstants import *

class App(Tkinter.Frame):
     def __init__(self, master=None):
         Tkinter.Frame.__init__(self, master)
         self.pack(pady=0, ipady=0)
         canvas1 = Tkinter.Canvas(self, background='#000000', borderwidth=0)
         canvas2 = Tkinter.Canvas(self, background='#000000', borderwidth=0)

         canvas1.pack(pady=0)
         canvas2.pack(pady=0)

if __name__ == '__main__':
     myapp = App()
     myapp.mainloop()


More information about the Tutor mailing list