-
Notifications
You must be signed in to change notification settings - Fork 0
/
ParliProgram.py
64 lines (42 loc) · 1.56 KB
/
ParliProgram.py
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
from tkinter import *
# global_vars
names = ["Kelly", "Dan", "John", "Reno", "Brian", "Mario", "Smitty", "Eric", "Josh", "Jacob", "Bethany"]
class View:
def __init__(self, master):
self.selected = ""
self.title_names = Label(master, text="Names")
self.title_names.grid(row=0, column=0)
self.names = Listbox(master)
self.names.grid(row=1, rowspan=4, column=0)
self.want = Button(master, text="-->", command=self.add)
self.want.grid(row=1, column=1)
self.spoke = Button(master, text="<--", command=self.remove)
self.spoke.grid(row=2, column=1)
self.clr = Button(master, text="CLR", command=self.clear)
self.clr.grid(row=3, column=1)
self.spoke = Label(master, text="Speaker's List")
self.spoke.grid(row=0, column=2)
self.list = Listbox(master)
self.list.grid(row=1, rowspan=4, column=2)
self.names.bind('<<ListboxSelect>>', self.onselect)
self.fill_list()
def onselect(self, evt):
w = evt.widget
index = int(w.curselection()[0])
self.selected = w.get(index)
def fill_list(self):
# You should make this take a file, and populate the list using the names in the file
# Love, Reno
# Agreed
for item in names:
self.names.insert(END, item)
def add(self):
self.list.insert(END, self.selected)
pass
def remove(self):
self.list.delete(0, 0)
def clear(self):
self.list.delete(0, END)
root = Tk()
app = View(root)
root.mainloop()