Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / src / nas,5.n2.os.2 / lib / python / lib / python2.4 / site-packages / Pmw / Pmw_1_2 / demos / AboutDialog.py
CommitLineData
86530b38
AT
1title = 'Pmw.AboutDialog demonstration'
2
3# Import Pmw from this directory tree.
4import sys
5sys.path[:0] = ['../../..']
6
7import Tkinter
8import Pmw
9
10class 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.
35if __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()