|
1 |
| -from main import ProgramVer |
| 1 | +# Import Statements |
| 2 | +from tkinter import * |
| 3 | +import os |
| 4 | + |
| 5 | +# Document Functions |
| 6 | +def openLicense(): |
| 7 | + windowl = Tk() |
| 8 | + licensefile = open('LICENSE.txt', 'r') #change file address as needed |
| 9 | + licensecontents = licensefile.read() |
| 10 | + licensefile.close() |
| 11 | + windowl.title('License') |
| 12 | + licensetext = Text(windowl) |
| 13 | + licensetext.insert(INSERT, licensecontents) |
| 14 | + licensetext.pack() |
| 15 | + |
| 16 | +def openEULA(): |
| 17 | + windowl = Tk() |
| 18 | + eulafile = open('EULA.txt', 'r') # change file address as needed |
| 19 | + eulacontents = eulafile.read() |
| 20 | + eulafile.close() |
| 21 | + windowl.title('EULA') |
| 22 | + eulatext = Text(windowl) |
| 23 | + eulatext.insert(INSERT, eulacontents) |
| 24 | + eulatext.pack() |
| 25 | + |
| 26 | +# ProgramVer Function |
| 27 | +def ProgramVer(): |
| 28 | + window = Tk() |
| 29 | + # Window Elements |
| 30 | + window.title('Copyright & Version Info for ProgramVer') #change name based on program name |
| 31 | + # UI Elements |
| 32 | + dfdimage = PhotoImage(file='imgs/dfdlogo.gif') |
| 33 | + pythonimage = PhotoImage(file='imgs/pythonpoweredlengthgif.gif') |
| 34 | + dfdlogo = Label(window, image = dfdimage) |
| 35 | + pythonpowered = Label(window, image = pythonimage) |
| 36 | + info = Label(window, text='ProgramVer \n Version: 1.9.0 (Build #)') #change respectively |
| 37 | + trademarks = Label(window, text='Copyright (C) 2017 - 2022 Dog Face Development Co. All rights reserved in all countries. \n ProgramVer and its code, user interface and all other associated trademarks are protected \nby trademarks and copyright in Canada, the United States and other countries.') #change as needed |
| 38 | + licenseblurb = Label(window, text="""\n ProgramVer - Version window for DFD Co.'s programs |
| 39 | + Copyright (C) 2017-2022 Dog Face Development Company |
| 40 | + |
| 41 | + This program is free software: you can redistribute it and/or modify |
| 42 | + it under the terms of the GNU General Public License as published by |
| 43 | + the Free Software Foundation, version 3 of the License. |
| 44 | +
|
| 45 | + This program is distributed in the hope that it will be useful, |
| 46 | + but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 47 | + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 48 | + GNU General Public License below for more details.""") #change as needed |
| 49 | + licensebtn = Button(window, text='Open License', command=openLicense) |
| 50 | + eulabtn = Button(window, text='Open EULA', command=openEULA) |
| 51 | + # Pack Statements |
| 52 | + dfdlogo.pack(side=TOP) |
| 53 | + info.pack(side=TOP) |
| 54 | + trademarks.pack(side=TOP) |
| 55 | + licenseblurb.pack(side=TOP) |
| 56 | + licensebtn.pack(pady=5) |
| 57 | + eulabtn.pack(pady=5) |
| 58 | + pythonpowered.pack(side=BOTTOM) |
| 59 | + # Maintain Window |
| 60 | + window.mainloop() |
| 61 | + |
2 | 62 |
|
3 | 63 | if __name__ == '__main__':
|
4 | 64 | ProgramVer()
|
0 commit comments