1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16 """
17 gui.py - classes for the graphical user interface. This is not an actual GUI
18 application but a collection of helper classes
19 """
20
21 import wx
22 import wx.html
23
25 """Panel to display HTML content. This panel updates it's content on
26 calls to update(event). UpdateHtmlPanels are typically used to show rankings and
27 connected to an EventObserver to automatically update.
28 """
29
30 - def __init__(self, parent, content = None):
31 super(type(self), self).__init__(parent)
32
33 self._content = content
34
35
36 self.SetStandardFonts()
37 self.update(None)
38
40 """Update the content of the panel."""
41 if self._content is not None:
42 self.SetPage(unicode(self._content))
43 else:
44 self.SetPage('')
45
46 - def _set_content(self, content):
47 self._content = content
48 self.update(None)
49
50 - def _get_content(self):
52
53 content = property(_get_content, _set_content)
54