Click here to Skip to main content
15,915,869 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
it can't show file,edit,view,color_menu

What I have tried:

Python
import tkinter as tk
from tkinter import ttk
from tkinter import font, colorchooser, messagebox
import os

main_application=tk.Tk()
main_application.geometry('1200x800')
main_application.title('vpad text editer')

main_menu=tk.Menu()
file = tk.Menu(main_menu, tearoff=False)
edit = tk.Menu(main_menu, tearoff=False)
view=tk.Menu(main_menu, tearoff=False)
color_theme=tk.Menu(main_menu, tearoff=False)

main_menu.add_cascade(label='file', menu=file)
main_menu.add_cascade(label='edit', menu=edit)
main_menu.add_cascade(label='view', menu=view)
main_menu.add_cascade(label='color Theme', menu=color_theme)

main_application.mainloop()
Posted
Updated 16-Nov-20 22:13pm
v2

1 solution

You have created the menu, but you have not connected it to your main window. Add the following line before the call to main_application.mainloop.
Python
main_application.config(menu=main_menu)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900