-
Notifications
You must be signed in to change notification settings - Fork 0
/
pgmsface.py
executable file
·49 lines (34 loc) · 1.36 KB
/
pgmsface.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
#!/usr/bin/python2.7
# Copyright 2014 by Andrew L. Blais.
# This program is distributed under the terms of the
# GNU General Public License version 3.
from Tkinter import LabelFrame, GROOVE, Button, Tk, StringVar, Label
from tkFileDialog import askopenfilename
#import tkFont
class pgmsface(LabelFrame):
def getPGMfileName(self):
options = {'filetypes': [('pgm files', '.pgm')]}
f = askopenfilename(**options)
g = f.split('/')
self.filenameVar.set(g[len(g) - 1])
return f
def __init__(self, x):
LabelFrame.__init__(self, x)
# self.default_font = tkFont.nametofont("TkDefaultFont")
# self.default_font.configure(family="Helvetica",size=10)
self.config(relief=GROOVE)
self.config(borderwidth=2)
self.config(text = "Testing")
self.config(labelanchor = "n")
self.loadPGMbutton = Button(self, text="Load PGM")
self.loadPGMbutton.grid(row=0, column=0)
self.filenameVar = StringVar()
self.filenameVar.set("*****.pgm")
self.fileNameLabel = Label(self, textvariable=self.filenameVar)
self.fileNameLabel.config(relief=GROOVE, borderwidth=2, width=18)
self.fileNameLabel.grid(row=0, column=1)
self.pack()
if __name__ == '__main__':
root = Tk()
pf = pgmsface(root)
root.mainloop()