[Tutor] Tkinter canvas on frame

Alan Gauld alan.gauld at yahoo.co.uk
Sun Feb 27 19:22:22 EST 2022


On 27/02/2022 23:00, Phil wrote:

> borderwidth and various pack options but still the coloured frame sits 
> above the canvas rather than surrounding the canvas. I've copied the 
> code from several examples but still the same result.
> 
> I've seen images showing what I have in mind but I have not discovered 
> how it's achieved.
> 
>>> from tkinter import *
>>> top = Tk()
>>> f = Frame(top,background="blue")
>>> f.pack(expand=True)
>>> b = Button(f, text='Hello World')
>>> b.pack(anchor='center', padx=10,pady=10)

Is that what you mean?

It seems I mis-spoke when I suggested a colored border,
you only get the default frame colour

-- 
Alan G
Author of the Learn to Program web site
http://www.alan-g.me.uk/
http://www.amazon.com/author/alan_gauld
Follow my photo-blog on Flickr at:
http://www.flickr.com/photos/alangauldphotos




More information about the Tutor mailing list