Tkinter pack w/o gutter

Matthew Dixon Cowles matt at mondoinfo.com
Wed Oct 3 21:26:11 CEST 2001


On 3 Oct 2001 11:13:15 -0700, Phlip <pplumlee at celterra.com> wrote:

>Try this snip:
>
>  from Tkinter import *
>  tk = Tk()
> 
>  for side in ('left', 'right'):
>	canvas = Canvas(tk, background='blue', width = 100, height = 100)
>	canvas.pack(side = side, padx = "0m")
>
>  mainloop()
>
>Observe how there is a gutter of 2 pixels (one per canvas) between
>them.
>
>How do I get rid of this gutter?
>
>'padx = 2' stretches the gutter out, but 'padx = 0' does not get rid
>of it. Other experiments, such as with 'ipadx', don't work.

I think that adding highlightthickness=0 to your canvas's options
will do what you want.

Regards,
Matt



More information about the Python-list mailing list