-
Notifications
You must be signed in to change notification settings - Fork 0
/
GUI.py
74 lines (59 loc) · 2.44 KB
/
GUI.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
65
66
67
68
69
70
71
72
73
74
# -*- coding: utf-8 -*-
from main import *
from Tkinter import *
import Tkinter, Tkconstants, tkFileDialog
def GUI():
root = Tk()
checkVar = IntVar()
y1PathEntry = Entry(root)
y2PathEntry = Entry(root)
titleEntry = Entry(root)
xLabelEntry = Entry(root)
y1LabelEntry = Entry(root)
y2LabelEntry = Entry(root)
def y1DirPick():
y1PathEntry.delete(0, "end")
root.y1DirPath = tkFileDialog.askdirectory(initialdir="/home/melimat/Documents/CO2", title="Select directory")
y1PathEntry.insert(10, root.y1DirPath)
def y2DirPick():
y2PathEntry.delete(0, "end")
root.y2DirPath = tkFileDialog.askdirectory(initialdir="/home/melimat/Documents/CO2", title="Select directory")
y2PathEntry.insert(10, root.y2DirPath)
def generate():
y1Path = y1PathEntry.get()
y2Path = y2PathEntry.get()
Title = titleEntry.get()
XLabel = xLabelEntry.get()
Y1Label = y1LabelEntry.get()
Y2Label = y2LabelEntry.get()
chckVar = checkVar.get()
root.destroy()
main(y1Path, y2Path, Title, XLabel, Y1Label, Y2Label, chckVar)
y1PickButton = Button(root, text="...", command=y1DirPick)
y2PickButton = Button(root, text="...", command=y2DirPick)
check = Checkbutton(root, text="Distinguish lines: ", variable=checkVar)
okButton = Button(root, text="OK", command=generate)
y1PathEntryLabel = Label(root, text="Path to Y1 data: ", height=4)
y2PathEntryLabel = Label(root, text="Path to Y2 data: ", height=4)
titleEntryLabel = Label(root, text="Title for graph: ", height=4)
xLabelEntryLabel = Label(root, text="X Axis label: ", height=4)
y1LabelEntryLabel = Label(root, text="Y1 Axis label: ", height=4)
y2LabelEntryLabel = Label(root, text="Y2 Axis label: ", height=4)
y1PathEntryLabel.grid(row=0, column=0)
y2PathEntryLabel.grid(row=1, column=0)
titleEntryLabel.grid(row=2, column=0)
xLabelEntryLabel.grid(row=3, column=0)
y1LabelEntryLabel.grid(row=4, column=0)
y2LabelEntryLabel.grid(row=5, column=0)
y1PathEntry.grid(row=0, column=1)
y2PathEntry.grid(row=1, column=1)
titleEntry.grid(row=2, column=1)
xLabelEntry.grid(row=3, column=1)
y1LabelEntry.grid(row=4, column=1)
y2LabelEntry.grid(row=5, column=1)
y1PickButton.grid(row=0, column=2)
y2PickButton.grid(row=1, column=2)
check.grid(row=6, column=1)
okButton.grid(row=7, column=1)
root.mainloop()
GUI()