class AboutDialog(Pmw
.MessageDialog
):
# Window to display version and contact information.
# Class members containing resettable 'default' values:
def __init__(self
, parent
= None, **kw
):
# Define the megawidget options.
('applicationname', '', INITOPT
),
('icon_bitmap', 'info', None),
('buttons', ('Close',), None),
('defaultbutton', 0, None),
self
.defineoptions(kw
, optiondefs
)
# Initialise the base class (after defining the options).
Pmw
.MessageDialog
.__init
__(self
, parent
)
applicationname
= self
['applicationname']
if not kw
.has_key('title'):
self
.configure(title
= 'About ' + applicationname
)
if not kw
.has_key('message_text'):
text
= applicationname
+ '\n\n'
if AboutDialog
._version
!= '':
text
= text
+ 'Version ' + AboutDialog
._version
+ '\n'
if AboutDialog
._copyright
!= '':
text
= text
+ AboutDialog
._copyright
+ '\n\n'
if AboutDialog
._contact
!= '':
text
= text
+ AboutDialog
._contact
self
.configure(message_text
=text
)
# Check keywords and initialise options.
AboutDialog
._version
= value
def aboutcopyright(value
):
AboutDialog
._copyright
= value
AboutDialog
._contact
= value