Skip to content
Permalink
Browse files
Create Machine_Status
  • Loading branch information
ndugwaj committed Dec 1, 2022
1 parent 0ca8755 commit 998234938ab687069ab8c794f912bca520dfa252
Showing 1 changed file with 44 additions and 0 deletions.
@@ -0,0 +1,44 @@
import tkinter as tk
from tkinter import ttk


root = tk.Tk()
root.title("Tab Widget")
tabControl = ttk.Notebook(root)

tab1 = ttk.Frame(tabControl)


tabControl.add(tab1, text ='Machine Status')
tabControl.pack(expand = 1, fill ="both")

ttk.Label(tab1,
text ="Welcome to Machine Status Control").grid(column = 0,
row = 0,
padx = 30,
pady = 30)

v = tk.IntVar()
v.set(1) # initializing the choice, i.e. Python

languages = [("Working", 101),
("Not Working", 102),
("Needs Supervision", 103)]

def ShowChoice():
print(v.get())

tk.Label(root,
text="""Choose the machine Status:""",
justify = tk.LEFT,
padx = 20).pack()

for language, val in languages:
tk.Radiobutton(root,
text=language,
indicatoron = 0,
padx = 20,
variable=v,
command=ShowChoice,
value=val).pack(anchor=tk.W)
root.mainloop()

0 comments on commit 9982349

Please sign in to comment.