mirror of
https://github.com/python/cpython.git
synced 2025-08-01 23:53:15 +00:00
improve viewfile handling
indentation style changed to match existing source
This commit is contained in:
parent
6cd441d129
commit
885c0bbd54
1 changed files with 122 additions and 117 deletions
|
@ -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()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue