2 from wxPython
.wx
import *
4 #----------------------------------------------------------------------
6 ## class MyFontEnumerator(wxFontEnumerator):
7 ## def __init__(self, list):
8 ## wxFontEnumerator.__init__(self)
11 ## def OnFacename(self, face):
12 ## self.list.append(face)
17 class TestPanel(wxPanel
):
18 def __init__(self
, parent
, log
):
19 wxPanel
.__init
__(self
, parent
, -1)
22 ## e = MyFontEnumerator(list)
23 ## e.EnumerateFacenames()
25 e
= wxFontEnumerator()
26 e
.EnumerateFacenames()
27 list = e
.GetFacenames()
31 wxStaticText(self
, -1, "Face names:", wxPoint(15, 50), wxSize(65, 18))
32 self
.lb1
= wxListBox(self
, 60, wxPoint(80, 50), wxSize(200, 250),
34 self
.lb1
.SetSelection(0)
39 #----------------------------------------------------------------------
41 def runTest(frame
, nb
, log
):
42 win
= TestPanel(nb
, log
)
45 #----------------------------------------------------------------------
59 wxFontEnumerator enumerates either all available fonts on the system or only the ones with given attributes - either only fixed-width (suited for use in programs such as terminal emulators and the like) or the fonts available in the given encoding.