]> git.saurik.com Git - wxWidgets.git/blob - wxPython/demo/About.py
mention ShouldInheritColours() change
[wxWidgets.git] / wxPython / demo / About.py
1 import sys
2
3 import wx # This module uses the new wx namespace
4 import wx.html
5 import wx.lib.wxpTag
6
7 #---------------------------------------------------------------------------
8
9 class MyAboutBox(wx.Dialog):
10 text = '''
11 <html>
12 <body bgcolor="#AC76DE">
13 <center><table bgcolor="#458154" width="100%%" cellspacing="0"
14 cellpadding="0" border="1">
15 <tr>
16 <td align="center">
17 <h1>wxPython %s</h1>
18 Running on Python %s<br>
19 </td>
20 </tr>
21 </table>
22
23 <p><b>wxPython</b> is a Python extension module that
24 encapsulates the wxWindows GUI classes.</p>
25
26 <p>This demo shows off some of the capabilities
27 of <b>wxPython</b>. Select items from the menu or tree control,
28 sit back and enjoy. Be sure to take a peek at the source code for each
29 demo item so you can learn how to use the classes yourself.</p>
30
31 <p><b>wxPython</b> is brought to you by <b>Robin Dunn</b> and<br>
32 <b>Total Control Software,</b> Copyright (c) 1997-2003.</p>
33
34 <p>
35 <font size="-1">Please see <i>license.txt</i> for licensing information.</font>
36 </p>
37
38 <p><wxp module="wx" class="Button">
39 <param name="label" value="Okay">
40 <param name="id" value="ID_OK">
41 </wxp></p>
42 </center>
43 </body>
44 </html>
45 '''
46 def __init__(self, parent):
47 wx.Dialog.__init__(self, parent, -1, 'About the wxPython demo',)
48 html = wx.html.HtmlWindow(self, -1, size=(420, -1))
49 py_version = sys.version.split()[0]
50 html.SetPage(self.text % (wx.VERSION_STRING, py_version))
51 btn = html.FindWindowById(wx.ID_OK)
52 btn.SetDefault()
53 ir = html.GetInternalRepresentation()
54 html.SetSize( (ir.GetWidth()+25, ir.GetHeight()+25) )
55 self.SetClientSize(html.GetSize())
56 self.CentreOnParent(wx.BOTH)
57
58 #---------------------------------------------------------------------------
59
60
61
62 if __name__ == '__main__':
63 app = wx.PySimpleApp()
64 dlg = MyAboutBox(None)
65 dlg.ShowModal()
66 dlg.Destroy()
67 app.MainLoop()
68