Initial commit of OpenSPARC T2 architecture model.
[OpenSPARC-T2-SAM] / sam-t2 / devtools / amd64 / lib / python2.4 / site-packages / Pmw / Pmw_1_2 / lib / PmwAboutDialog.py
CommitLineData
920dae64
AT
1import Pmw
2
3class AboutDialog(Pmw.MessageDialog):
4 # Window to display version and contact information.
5
6 # Class members containing resettable 'default' values:
7 _version = ''
8 _copyright = ''
9 _contact = ''
10
11 def __init__(self, parent = None, **kw):
12
13 # Define the megawidget options.
14 INITOPT = Pmw.INITOPT
15 optiondefs = (
16 ('applicationname', '', INITOPT),
17 ('iconpos', 'w', None),
18 ('icon_bitmap', 'info', None),
19 ('buttons', ('Close',), None),
20 ('defaultbutton', 0, None),
21 )
22 self.defineoptions(kw, optiondefs)
23
24 # Initialise the base class (after defining the options).
25 Pmw.MessageDialog.__init__(self, parent)
26
27 applicationname = self['applicationname']
28 if not kw.has_key('title'):
29 self.configure(title = 'About ' + applicationname)
30
31 if not kw.has_key('message_text'):
32 text = applicationname + '\n\n'
33 if AboutDialog._version != '':
34 text = text + 'Version ' + AboutDialog._version + '\n'
35 if AboutDialog._copyright != '':
36 text = text + AboutDialog._copyright + '\n\n'
37 if AboutDialog._contact != '':
38 text = text + AboutDialog._contact
39
40 self.configure(message_text=text)
41
42 # Check keywords and initialise options.
43 self.initialiseoptions()
44
45def aboutversion(value):
46 AboutDialog._version = value
47
48def aboutcopyright(value):
49 AboutDialog._copyright = value
50
51def aboutcontact(value):
52 AboutDialog._contact = value