Kaydet (Commit) 885c0bbd authored tarafından Steven M. Gava's avatar Steven M. Gava

improve viewfile handling

indentation style changed to match existing source
üst 6cd441d1
......@@ -8,7 +8,7 @@
about box for idle
"""
from Tkinter import *
import string
import string, os
import textView
import idlever
class AboutDialog(Toplevel):
......@@ -116,12 +116,14 @@ class AboutDialog(Toplevel):
self.buttonLicense.invoke()
def ShowLicense(self):
textView.TextViewer(self,title='About - Readme',
fileName='./README.txt')
self.ViewFile('About - Readme','README.txt')
def ShowCredits(self):
textView.TextViewer(self,title='About - Credits',
fileName='./CREDITS.txt')
self.ViewFile('About - Credits','CREDITS.txt')
def ViewFile(self,viewTitle,viewFile):
fn=os.path.join(os.path.abspath(os.path.dirname(__file__)),viewFile)
textView.TextViewer(self,viewTitle,fn)
def Ok(self, event=None):
self.destroy()
......@@ -129,5 +131,8 @@ class AboutDialog(Toplevel):
if __name__ == '__main__':
#test the dialog
root=Tk()
Button(root,text='About',command=lambda:AboutDialog(root,'About')).pack()
def run():
import aboutDialog
aboutDialog.AboutDialog(root,'About')
Button(root,text='Dialog',command=run).pack()
root.mainloop()
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment