-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAtk_Detect_User_Interface.py
More file actions
45 lines (38 loc) · 1.17 KB
/
Atk_Detect_User_Interface.py
File metadata and controls
45 lines (38 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
# from Tkinter import *
# root = Tk()
# root.geometry("1920x1080")
# root.title("SCADA ATTACK DETECTION MONITORING SYSTEM")
# var = StringVar()
# label = Label(root, textvariable=var, relief=RAISED)
# var.set("Hey man, how are you?")
# label.pack(side=LEFT, fill=X, expand=1)
# root.mainloop()
##########################################
# Example of dropdown list #
##########################################
# using Tkinter's Optionmenu() as a combobox
try:
# Python2
import Tkinter as tk
except ImportError:
# Python3
import tkinter as tk
def select():
sf = "value is %s" % var.get()
root.title(sf)
# optional
color = var.get()
root['bg'] = color
root = tk.Tk()
# use width x height + x_offset + y_offset (no spaces!)
root.geometry("%dx%d+%d+%d" % (330, 80, 200, 150))
root.title("tk.Optionmenu as combobox")
var = tk.StringVar(root)
# initial value
var.set('red')
choices = ['red', 'green', 'blue', 'yellow','white', 'magenta']
option = tk.OptionMenu(root, var, *choices)
option.pack(side='left', padx=10, pady=10)
button = tk.Button(root, text="check value slected", command=select)
button.pack(side='left', padx=20, pady=10)
root.mainloop()