Experiment : 05
Title : Creating GUI with python containing widgets such as labels,
textbox, radio, checkboxes and custom dialog boxes.
Program:
import tkinter as tk
from tkinter import messagebox
Aim : Create a new window
root = [Link]()
Aim : Set the title of the window
[Link]("My GUI")
Aim : Create a label widget
label = [Link](root, text="Welcome to my GUI!")
[Link]()
Aim : Create a textbox widget
textbox = [Link](root)
[Link]()
Aim : Create a radio button widget
radio = [Link](root, text="Option 1",
value=1) [Link]()
radio2 = [Link](root, text="Option 2",
value=2) [Link]()
Aim : Create a checkbox widget
checkbox = [Link](root, text="Check me!")
[Link]()
Aim : Create a custom dialog box
def showDialog():
[Link]("Message", "Hello World!")
button = [Link](root, text="Click me",
command=showDialog)
[Link]()
Aim : Start the main loop of the window
[Link]()
Output:
Conclusion: We have written basic program to create a basic GUI