0% found this document useful (0 votes)
3 views

Menu

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
3 views

Menu

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

import os

import shutil
import random
import functools
import time
import threading
from tkinter import colorchooser
from tkinter import *
from tkinter import filedialog

def change_bg_color():
color=colorchooser.askcolor()
bg_color=color[1]
window.config(bg=bg_color)

window=Tk()

window.geometry('500x500')

saveImage=PhotoImage(file='D:\\Download\\floppy.png')
openImage=PhotoImage(file='D:\\Download\\openimage.png')

text=Text(window)
text.pack()

menuBar=Menu(window)
window.config(menu=menuBar)

fileMenu=Menu(menuBar,tearoff=False)
menuBar.add_cascade(label="File",menu=fileMenu)

editMenu=Menu(menuBar,tearoff=False)
menuBar.add_cascade(label="Edit",menu=editMenu)

fileMenu.add_command(label="Open",image=openImage,compound=LEFT)
fileMenu.add_command(label="Save",image=saveImage,compound=LEFT)
fileMenu.add_separator()
fileMenu.add_command(label="Exit",command=window.quit)

editMenu.add_command(label="Change bg color",command=change_bg_color)

window.mainloop()

You might also like