]>
git.saurik.com Git - wxWidgets.git/blob - utils/wxPython/demo/FontEnumerator.py
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 ()
26 wxStaticText ( self
, - 1 , "Face names:" , wxPoint ( 15 , 50 ), wxSize ( 65 , 18 ))
27 self
. lb1
= wxListBox ( self
, 60 , wxPoint ( 80 , 50 ), wxSize ( 200 , 250 ),
29 self
. lb1
. SetSelection ( 0 )
34 #----------------------------------------------------------------------
36 def runTest ( frame
, nb
, log
):
37 win
= TestPanel ( nb
, log
)
40 #----------------------------------------------------------------------
54 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.