| 1 | title = 'Pmw.AboutDialog demonstration' |
| 2 | |
| 3 | # Import Pmw from this directory tree. |
| 4 | import sys |
| 5 | sys.path[:0] = ['../../..'] |
| 6 | |
| 7 | import Tkinter |
| 8 | import Pmw |
| 9 | |
| 10 | class Demo: |
| 11 | def __init__(self, parent): |
| 12 | # Create dialog. |
| 13 | Pmw.aboutversion('9.9') |
| 14 | Pmw.aboutcopyright('Copyright My Company 1999\nAll rights reserved') |
| 15 | Pmw.aboutcontact( |
| 16 | 'For information about this application contact:\n' + |
| 17 | ' My Help Desk\n' + |
| 18 | ' Phone: +61 2 9876 5432\n' + |
| 19 | ' email: help@my.company.com.au' |
| 20 | ) |
| 21 | self.about = Pmw.AboutDialog(parent, applicationname = 'My Application') |
| 22 | self.about.withdraw() |
| 23 | |
| 24 | # Create button to launch the dialog. |
| 25 | w = Tkinter.Button(parent, text = 'Show about dialog', |
| 26 | command = self.execute) |
| 27 | w.pack(padx = 8, pady = 8) |
| 28 | |
| 29 | def execute(self): |
| 30 | self.about.show() |
| 31 | |
| 32 | ###################################################################### |
| 33 | |
| 34 | # Create demo in root window for testing. |
| 35 | if __name__ == '__main__': |
| 36 | root = Tkinter.Tk() |
| 37 | Pmw.initialise(root) |
| 38 | root.title(title) |
| 39 | |
| 40 | exitButton = Tkinter.Button(root, text = 'Exit', command = root.destroy) |
| 41 | exitButton.pack(side = 'bottom') |
| 42 | widget = Demo(root) |
| 43 | root.mainloop() |