tkinter.Frame(background)


Definition
The background generate the Frame background.

Syntax
tkinter.Frame(color=RGB)

Example
Frame(background)
The Frame width, height, and background color is created.
from tkinter import*

master=Tk()

frame=Frame(master, width=300, height=300, background="blue")

frame.pack()

master.mainloop()





The frame "<ButtonRelease>" trigger the function(buttonrelease) which displays the Label(welcome).
from tkinter import *

master = Tk()

def buttonrelease(click):
    label=Label(frame, text="Welcome", fg="Blue")
    label.pack(side=TOP)

frame = Frame(master, background="blue", width=200, height=200)
frame.bind("<ButtonRelease>", buttonrelease)
frame.pack()

master.mainloop()








Comments