| 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 | (%s)<br> |
| 19 | Running on Python %s<br> |
| 20 | </td> |
| 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> |
| 33 | <b>Total Control Software,</b> Copyright (c) 1997-2006.</p> |
| 34 | |
| 35 | <p> |
| 36 | <font size="-1">Please see <i>license.txt</i> for licensing information.</font> |
| 37 | </p> |
| 38 | |
| 39 | <p><wxp module="wx" class="Button"> |
| 40 | <param name="label" value="Okay"> |
| 41 | <param name="id" value="ID_OK"> |
| 42 | </wxp></p> |
| 43 | </center> |
| 44 | </body> |
| 45 | </html> |
| 46 | ''' |
| 47 | def __init__(self, parent): |
| 48 | wx.Dialog.__init__(self, parent, -1, 'About the wxPython demo',) |
| 49 | html = wx.html.HtmlWindow(self, -1, size=(420, -1)) |
| 50 | if "gtk2" in wx.PlatformInfo: |
| 51 | html.SetStandardFonts() |
| 52 | py_version = sys.version.split()[0] |
| 53 | txt = self.text % (wx.VERSION_STRING, |
| 54 | ", ".join(wx.PlatformInfo[1:]), |
| 55 | py_version |
| 56 | ) |
| 57 | html.SetPage(txt) |
| 58 | btn = html.FindWindowById(wx.ID_OK) |
| 59 | ir = html.GetInternalRepresentation() |
| 60 | html.SetSize( (ir.GetWidth()+25, ir.GetHeight()+25) ) |
| 61 | self.SetClientSize(html.GetSize()) |
| 62 | self.CentreOnParent(wx.BOTH) |
| 63 | |
| 64 | #--------------------------------------------------------------------------- |
| 65 | |
| 66 | |
| 67 | |
| 68 | if __name__ == '__main__': |
| 69 | app = wx.PySimpleApp() |
| 70 | dlg = MyAboutBox(None) |
| 71 | dlg.ShowModal() |
| 72 | dlg.Destroy() |
| 73 | app.MainLoop() |
| 74 | |