Amazing technological breakthrough possible @S-Logix pro@slogix.in

Office Address

  • #5, First Floor, 4th Street Dr. Subbarayan Nagar Kodambakkam, Chennai-600 024 Landmark : Samiyar Madam
  • pro@slogix.in
  • +91- 81240 01111

Social List

How to create menu and message widget in GUI using python?

Description

To create menu and message widget in python3.

Process
Menu widget

   It is used to create all kinds of menus used by the application.

Syntax:

  M=Menu(root, options=value)

Message widget

   The widget can be used to display short text messages.

Syntax:

   M=Message(root, options=value)

Sample Code

#import tkinter

import tkinter as tk

from tkinter import *

 

#root window

root = tk.Tk()

menu = Menu(root)

root.config(menu=menu)

 

#menu widget

filemenu = Menu(menu)

menu.add_cascade

(label=’File’, menu=filemenu)

filemenu.add_command(label=’New’)

filemenu.add_command(label=’Open’)

filemenu.add_separator()

filemenu.add_command

(label=’Exit’, command=root.quit)

helpmenu = Menu(menu)

menu.add_cascade

(label=’Help’, menu=helpmenu)

helpmenu.add_command

(label=’About’)

tk.mainloop()

Screenshots
create menu and message widget in GUI using python
menu and message widget in python3