4 <meta name="description" content="Pmw - a toolkit for building high-level compound widgets in Python">
5 <meta name="content" content="python, megawidget, mega widget, compound widget, gui, tkinter">
6 <title>Pmw.AboutDialog reference manual</title>
9 <body bgcolor="#ffffff" text="#000000" link="#0000ee"
10 vlink="551a8b" alink="ff0000">
12 <h1 ALIGN="CENTER">Pmw.AboutDialog</h1>
14 <center><IMG SRC=AboutDialog.gif ALT="" WIDTH=378 HEIGHT=284></center>
16 <dt> <h3>Name</h3></dt><dd>
17 <p>Pmw.AboutDialog() -
18 window to display version and contact information
23 <dt> <h3>Inherits</h3></dt><dd>
24 <a href="MessageDialog.html">Pmw.MessageDialog</a><br>
26 <dt> <h3>Description</h3></dt><dd>
28 An about dialog is a dialog window which displays information
29 about the application, such as name, version, copyright and
32 <p> The text of the message is constructed from the application name
33 (given by the <strong>applicationname</strong> option) followed by the values
34 supplied in the most recent calls to <code>Pmw.aboutversion()</code>,
35 <code>Pmw.aboutcopyright()</code> and <code>Pmw.aboutcontact()</code> functions.</p>
37 <p> The icon of the message defaults to <strong>'info'</strong>, but may be changed
38 using the <strong>icon_bitmap</strong> component option.</p>
44 <dt> <h3>Options</h3></dt><dd>
45 Options for this megawidget and its base
46 classes are described below.<p></p>
47 <a name=option.activatecommand></a>
48 <dl><dt> <strong>activatecommand
50 If this is callable, it will be called whenever the megawidget is
51 activated by a call to <code>activate()</code>. The default is <strong>None</strong>.</p>
55 <a name=option.applicationname></a>
56 <dl><dt> <strong>applicationname
58 Initialisation option. The name of application, to be dispayed in the dialog body and in
59 the window title if the <strong>title</strong> option is not given. The default is <strong>''</strong>.</p>
63 <a name=option.borderx></a>
64 <dl><dt> <strong>borderx
66 Initialisation option. The padding to the left and right of the text message and icon. The default is <strong>20</strong>.</p>
70 <a name=option.bordery></a>
71 <dl><dt> <strong>bordery
73 Initialisation option. The padding above and below the text message and icon. The default is <strong>20</strong>.</p>
77 <a name=option.buttonboxpos></a>
78 <dl><dt> <strong>buttonboxpos
80 Initialisation option. Specifies on which side of the dialog window to place the button
81 box. Must be one of <strong>'n'</strong>, <strong>'s'</strong>, <strong>'e'</strong> or <strong>'w'</strong>. The default is <strong>'s'</strong>.</p>
85 <a name=option.buttons></a>
86 <dl><dt> <strong>buttons
88 This must be a tuple or a list and specifies the names on the
89 buttons in the button box. The default is <strong>('Close',)</strong>.</p>
93 <a name=option.command></a>
94 <dl><dt> <strong>command
96 Specifies a function to call whenever a button in the button box
97 is invoked or the window is deleted by the window manager. The
98 function is called with a single argument, which is the name of
99 the button which was invoked, or <strong>None</strong> if the window was deleted
100 by the window manager.</p>
101 <p> If the value of <strong>command</strong> is not callable, the default behaviour
102 is to deactivate the window if it is active, or withdraw the
103 window if it is not active. If it is deactivated, <code>deactivate()</code>
104 is called with the button name or <strong>None</strong> as described above. The default is <strong>None</strong>.</p>
109 <a name=option.deactivatecommand></a>
110 <dl><dt> <strong>deactivatecommand
112 If this is callable, it will be called whenever the megawidget is
113 deactivated by a call to <code>deactivate()</code>. The default is <strong>None</strong>.</p>
117 <a name=option.defaultbutton></a>
118 <dl><dt> <strong>defaultbutton
120 Specifies the default button in the button box. If the <strong><Return></strong>
121 key is hit when the dialog has focus, the default button will be
122 invoked. If <strong>defaultbutton</strong> is <strong>None</strong>, there will be no default
123 button and hitting the <strong><Return></strong> key will have no effect. The default is <strong>0</strong>.</p>
127 <a name=option.iconmargin></a>
128 <dl><dt> <strong>iconmargin
130 Initialisation option. The padding between the text message and icon. The default is <strong>20</strong>.</p>
134 <a name=option.iconpos></a>
135 <dl><dt> <strong>iconpos
137 Initialisation option. Specifies on which side of the text message to place the icon.
138 Must be one of <strong>'n'</strong>, <strong>'s'</strong>, <strong>'e'</strong> or <strong>'w'</strong>. The default is <strong>'w'</strong>.</p>
142 <a name=option.master></a>
143 <dl><dt> <strong>master
145 This is used by the <code>activate()</code> method to control whether the
146 window is made <em>transient</em> during modal dialogs. See the
147 <code>activate()</code> method. The default is <strong>'parent'</strong>.</p>
151 <a name=option.separatorwidth></a>
152 <dl><dt> <strong>separatorwidth
154 Initialisation option. If this is greater than <strong>0</strong>, a separator line with the specified
155 width will be created between the button box and the child site,
156 as a component named <strong>separator</strong>. Since the default border of the
157 button box and child site is <strong>raised</strong>, this option does not
158 usually need to be set for there to be a visual separation between
159 the button box and child site. The default is <strong>0</strong>.</p>
163 <a name=option.title></a>
164 <dl><dt> <strong>title
166 This is the title that the window manager displays in the title
167 bar of the window. The default is <strong>None</strong>.</p>
172 <dt> <h3>Components</h3></dt><dd>
173 Components created by this megawidget and its base
174 classes are described below.<p></p>
175 <a name=component.buttonbox></a>
176 <dl><dt> <strong>buttonbox
178 This is the button box containing the buttons for the dialog. By
179 default it is created with the options
180 <code>(hull_borderwidth = 1, hull_relief = 'raised')</code>. By default, this component is a <a href="ButtonBox.html">Pmw.ButtonBox</a>.</p>
184 <a name=component.dialogchildsite></a>
185 <dl><dt> <strong>dialogchildsite
187 This is the child site for the dialog, which may be used to
188 specialise the megawidget by creating other widgets within it. By
189 default it is created with the options
190 <code>(borderwidth = 1, relief = 'raised')</code>. By default, this component is a Tkinter.Frame.</p>
194 <a name=component.hull></a>
195 <dl><dt> <strong>hull
197 This acts as the body for the entire megawidget. Other components
198 are created as children of the hull to further specialise this
199 class. By default, this component is a Tkinter.Toplevel.</p>
203 <a name=component.icon></a>
204 <dl><dt> <strong>icon
206 If the <strong>iconpos</strong> option is not <strong>None</strong>, this component is created
207 to contain the icon label for the dialog. To display a bitmap as
208 an icon, set the <strong>icon_bitmap</strong> component option to any of the
209 forms acceptable to Tk, such as <strong>'warning'</strong> or <strong>'error'</strong>. By default, this component is a Tkinter.Label.</p>
213 <a name=component.message></a>
214 <dl><dt> <strong>message
216 The label to contain the text message for the dialog. To set
217 the text, use the <strong>message_text</strong> component option. By default, this component is a Tkinter.Label.</p>
221 <a name=component.separator></a>
222 <dl><dt> <strong>separator
224 If the <strong>separatorwidth</strong> initialisation option is non-zero, the
225 <strong>separator</strong> component is the line dividing the area between the
226 button box and the child site. By default, this component is a Tkinter.Frame.</p>
232 <dt> <h3>Methods</h3></dt><dd>
233 This megawidget has no methods of its own.
234 For a description of its inherited methods, see the
235 manual for its base class
236 <strong><a href="MessageDialog.html#methods">Pmw.MessageDialog</a></strong>.
239 <dt> <h3>Example</h3></dt><dd>
240 The image at the top of this manual is a snapshot
241 of the window (or part of the window) produced
242 by the following code.<p></p>
245 def __init__(self, parent):
247 Pmw.aboutversion('9.9')
248 Pmw.aboutcopyright('Copyright My Company 1999\nAll rights reserved')
250 'For information about this application contact:\n' +
252 ' Phone: +61 2 9876 5432\n' +
253 ' email: help@my.company.com.au'
255 self.about = Pmw.AboutDialog(parent, applicationname = 'My Application')
256 self.about.withdraw()
258 # Create button to launch the dialog.
259 w = Tkinter.Button(parent, text = 'Show about dialog',
260 command = self.execute)
261 w.pack(padx = 8, pady = 8)
270 <center><P ALIGN="CENTER">
271 <IMG SRC = blue_line.gif ALT = "" WIDTH=320 HEIGHT=5>
276 <center><P ALIGN="CENTER">
279 - <a href="index.html">Home</a>
280 <br>Manual page last reviewed: 18 May 2002