embedded system,Arduino,Raspberry pi,ARM7,MM32,STM32,PIC and Python,Django,Datascience and web development
Friday, February 12, 2021
day 36 menu bar using python
#from tkinter import Toplevel, Button, Tk, Menu ,Label
from tkinter import *
top = Tk()
def display_text():
w = Label(top,text="Hello Tkinter")
#new_win=Tk()
#new_win.geometry("300*400")
w.pack()
menubar = Menu(top)
file = Menu(menubar, tearoff=0)
file.add_command(label="New",command=display_text)
file.add_command(label="Open")
file.add_command(label="Save")
file.add_command(label="Save as...")
file.add_separator()
file.add_command(label="print")
file.add_command(label="print preview")
file.add_command(label="Close")
file.add_command(label="Exit", command=top.quit)
menubar.add_cascade(label="File", menu=file)
edit = Menu(menubar, tearoff=0)
edit.add_command(label="Undo")
edit.add_command(label="Cut")
edit.add_command(label="Copy")
edit.add_command(label="Paste")
edit.add_separator()
edit.add_command(label="Delete")
edit.add_command(label="Select All")
menubar.add_cascade(label="Edit", menu=edit)
help = Menu(menubar, tearoff=0)
help.add_command(label="About")
menubar.add_cascade(label="Help", menu=help)
view = Menu(menubar, tearoff=0)
view.add_command(label="View")
menubar.add_cascade(label="View", menu=view)
top.config(menu=menubar)
top.mainloop()
Subscribe to:
Post Comments (Atom)
-
How to do the programming python in windows command prompt Step 1: please go through below link website f...
-
Serial.print() Description Prints data to the serial port as human-readable ASCII text. This command can take many forms. Numbers a...
No comments:
Post a Comment