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